From c3690e380e2d8500ba8184c645afc93c0dbc0857 Mon Sep 17 00:00:00 2001 From: HailSanta <53960937+HailSanta@users.noreply.github.com> Date: Mon, 5 Jun 2023 04:16:46 -0400 Subject: [PATCH] battles organization (#1065) * sbk * pokey * bandit * check * missing part ID refs * nok progress * area headers * actors moved to common * dedupe all stages * couple missing actors and simplified includes * separated stages by world area * stage cleanup I * stage cleanup II * done stage cleanup --------- Co-authored-by: HailSanta --- include/enums.h | 23 +- include/script_api/battle.h | 2 +- src/16F740.c | 4 +- src/17D6A0.c | 16 +- src/17FEB0.c | 1 - src/181810.c | 1 - src/1A5830.c | 3 +- src/1AC760.c | 1 - src/415D90.c | 5 +- src/actor_api.c | 28 +- src/battle/action_cmd/air_raid.c | 1 - src/battle/action_cmd/fire_shell.c | 1 - src/battle/action_cmd/smack.c | 1 - src/battle/area/arn/actor/hyper_cleft.c | 845 +-------- src/battle/area/arn/actor/hyper_goomba.c | 3 + src/battle/area/arn/actor/hyper_paragoomba.c | 1499 +--------------- src/battle/area/arn/actor/tubba_blubba.c | 29 +- src/battle/area/arn/actor/tubbas_heart.c | 25 +- src/battle/area/arn/area.c | 199 ++- src/battle/area/arn/area.h | 6 + src/battle/area/arn/stage/arn_01.c | 33 +- src/battle/area/arn/stage/arn_02.c | 50 +- src/battle/area/arn/stage/arn_03.c | 33 +- src/battle/area/arn/stage/arn_04.c | 32 +- src/battle/area/arn/stage/arn_05.c | 32 +- src/battle/area/arn/stage/arn_06.c | 31 +- src/battle/area/dgb/actor/clubba.c | 4 +- src/battle/area/dgb/actor/tubba_blubba.c | 29 +- src/battle/area/dgb/area.c | 83 +- src/battle/area/dgb/area.h | 6 + src/battle/area/dgb/stage/dgb_01.c | 25 +- src/battle/area/dgb/stage/dgb_02.c | 25 +- src/battle/area/dgb/stage/dgb_03.c | 25 +- src/battle/area/dgb/stage/dgb_04.c | 31 +- src/battle/area/dgb/stage/dgb_05.c | 25 +- src/battle/area/dig/actor/bandit.c | 4 +- src/battle/area/dig/actor/fuzzy.c | 4 +- src/battle/area/dig/actor/koopa_troopa.c | 4 +- src/battle/area/dig/actor/monty_mole.c | 4 +- src/battle/area/dig/actor/pokey.c | 4 +- src/battle/area/dig/actor/red_shy_guy.c | 4 +- src/battle/area/dig/actor/tubba_blubba.c | 7 +- src/battle/area/dig/actor/whacka.c | 4 +- src/battle/area/dig/area.c | 102 +- src/battle/area/dig/area.h | 6 + src/battle/area/dig/script/dig_01.c | 5 +- src/battle/area/dig/script/dig_02.c | 5 +- src/battle/area/dig/script/dig_03.c | 5 +- src/battle/area/dig/script/dig_04.c | 5 +- src/battle/area/dig/script/dig_05.c | 5 +- src/battle/area/dig/stage/dig_01.c | 36 +- src/battle/area/dig/stage/dig_02.c | 35 +- src/battle/area/dig/stage/dig_03.c | 68 +- src/battle/area/dig/stage/dig_04.c | 65 +- src/battle/area/dig/stage/dig_05.c | 24 +- src/battle/area/flo/actor/amazy_dayzee.c | 381 +---- src/battle/area/flo/actor/bzzap.c | 4 +- src/battle/area/flo/actor/crazee_dayzee.c | 392 +---- src/battle/area/flo/actor/green_magikoopa.c | 4 +- src/battle/area/flo/actor/lakitu.c | 611 +------ src/battle/area/flo/actor/medi_guy.c | 4 +- src/battle/area/flo/actor/red_magikoopa.c | 4 +- src/battle/area/flo/actor/ruff_puff.c | 348 +--- src/battle/area/flo/actor/spiny.c | 4 +- src/battle/area/flo/actor/white_magikoopa.c | 4 +- src/battle/area/flo/actor/yellow_magikoopa.c | 4 +- src/battle/area/flo/area.c | 427 +++-- src/battle/area/flo/area.h | 6 + src/battle/area/flo/stage/flo_01.c | 8 +- src/battle/area/flo/stage/flo_01b.c | 8 +- src/battle/area/flo/stage/flo_01c.c | 8 +- src/battle/area/flo/stage/flo_02.c | 8 +- src/battle/area/flo/stage/flo_02b.c | 8 +- src/battle/area/flo/stage/flo_02c.c | 8 +- src/battle/area/flo/stage/flo_03.c | 8 +- src/battle/area/flo/stage/flo_04.c | 8 +- src/battle/area/flo/stage/flo_05.c | 7 +- src/battle/area/flo/stage/flo_06.c | 7 +- src/battle/area/flo2/actor/huff_n_puff.c | 17 +- src/battle/area/flo2/actor/monty_mole_boss.c | 29 +- src/battle/area/flo2/actor/spike.c | 43 +- src/battle/area/flo2/actor/tuff_puff.c | 29 +- src/battle/area/flo2/area.c | 105 +- src/battle/area/flo2/area.h | 6 + src/battle/area/flo2/stage/flo_01.c | 8 +- src/battle/area/flo2/stage/flo_01b.c | 8 +- src/battle/area/flo2/stage/flo_01c.c | 9 +- src/battle/area/flo2/stage/flo_02.c | 8 +- src/battle/area/flo2/stage/flo_02b.c | 8 +- src/battle/area/flo2/stage/flo_02c.c | 8 +- src/battle/area/flo2/stage/flo_03.c | 8 +- src/battle/area/flo2/stage/flo_04.c | 8 +- src/battle/area/flo2/stage/flo_05.c | 7 +- src/battle/area/flo2/stage/flo_06.c | 7 +- src/battle/area/hos/actor/ember.c | 4 +- src/battle/area/hos/actor/goombario_tutor.c | 14 +- src/battle/area/hos/actor/magikoopa.c | 80 +- src/battle/area/hos/area.c | 57 +- src/battle/area/hos/area.h | 6 + src/battle/area/hos/stage/hos_00.c | 83 +- src/battle/area/hos/stage/hos_01.c | 269 +-- src/battle/area/hos/stage/hos_02.c | 104 +- .../area/isk_part_1/actor/buzzy_beetle.c | 4 +- .../area/isk_part_1/actor/pokey_mummy.c | 1015 +---------- .../area/isk_part_1/actor/stone_chomp.c | 771 +-------- src/battle/area/isk_part_1/actor/swooper.c | 4 +- src/battle/area/isk_part_1/area.c | 285 ++-- src/battle/area/isk_part_1/area.h | 6 + src/battle/area/isk_part_1/stage/isk_00.c | 7 +- src/battle/area/isk_part_1/stage/isk_01.c | 7 +- src/battle/area/isk_part_1/stage/isk_02.c | 7 +- src/battle/area/isk_part_1/stage/isk_02b.c | 7 +- src/battle/area/isk_part_1/stage/isk_02c.c | 7 +- src/battle/area/isk_part_1/stage/isk_03.c | 7 +- src/battle/area/isk_part_1/stage/isk_03b.c | 7 +- src/battle/area/isk_part_1/stage/isk_04.c | 7 +- src/battle/area/isk_part_1/stage/isk_05.c | 7 +- src/battle/area/isk_part_1/stage/isk_06.c | 7 +- src/battle/area/isk_part_1/stage/isk_06b.c | 7 +- src/battle/area/isk_part_1/stage/isk_07.c | 7 +- src/battle/area/isk_part_1/stage/isk_08.c | 7 +- .../area/isk_part_2/actor/chain_chomp.c | 12 +- src/battle/area/isk_part_2/actor/tutankoopa.c | 13 +- src/battle/area/isk_part_2/area.c | 67 +- src/battle/area/isk_part_2/area.h | 6 + src/battle/area/isk_part_2/stage/isk_00.c | 7 +- src/battle/area/isk_part_2/stage/isk_01.c | 7 +- src/battle/area/isk_part_2/stage/isk_02.c | 7 +- src/battle/area/isk_part_2/stage/isk_02b.c | 7 +- src/battle/area/isk_part_2/stage/isk_02c.c | 7 +- src/battle/area/isk_part_2/stage/isk_03.c | 7 +- src/battle/area/isk_part_2/stage/isk_03b.c | 7 +- src/battle/area/isk_part_2/stage/isk_04.c | 7 +- src/battle/area/isk_part_2/stage/isk_05.c | 7 +- src/battle/area/isk_part_2/stage/isk_06.c | 7 +- src/battle/area/isk_part_2/stage/isk_06b.c | 7 +- src/battle/area/isk_part_2/stage/isk_07.c | 7 +- src/battle/area/iwa/actor/buzzar.c | 31 +- src/battle/area/iwa/actor/cleft.c | 553 +----- src/battle/area/iwa/actor/monty_mole.c | 4 +- src/battle/area/iwa/actor/whacka.c | 4 +- src/battle/area/iwa/area.c | 153 +- src/battle/area/iwa/area.h | 6 + src/battle/area/iwa/stage/iwa_01.c | 53 +- src/battle/area/iwa/stage/iwa_01b.c | 35 +- src/battle/area/iwa/stage/iwa_02.c | 48 +- src/battle/area/jan/actor/hurt_plant.c | 353 +--- src/battle/area/jan/actor/jungle_fuzzy.c | 839 +-------- src/battle/area/jan/actor/m_bush.c | 300 +--- src/battle/area/jan/actor/medi_guy.c | 8 +- src/battle/area/jan/actor/spear_guy.c | 1510 +---------------- src/battle/area/jan/actor/spike_top.c | 4 +- src/battle/area/jan/area.c | 221 ++- src/battle/area/jan/area.h | 6 + src/battle/area/jan/stage/jan_00.c | 8 +- src/battle/area/jan/stage/jan_01.c | 7 +- src/battle/area/jan/stage/jan_01b.c | 7 +- src/battle/area/jan/stage/jan_02.c | 7 +- src/battle/area/jan/stage/jan_03.c | 7 +- src/battle/area/jan/stage/jan_03b.c | 7 +- src/battle/area/jan/stage/jan_04.c | 7 +- src/battle/area/jan/stage/jan_04b.c | 7 +- src/battle/area/jan2/actor/putrid_piranha.c | 4 +- src/battle/area/jan2/actor/white_magikoopa.c | 4 +- src/battle/area/jan2/area.c | 81 +- src/battle/area/jan2/area.h | 6 + src/battle/area/jan2/stage/jan_00.c | 7 +- src/battle/area/jan2/stage/jan_01.c | 7 +- src/battle/area/jan2/stage/jan_01b.c | 7 +- src/battle/area/jan2/stage/jan_02.c | 7 +- src/battle/area/jan2/stage/jan_03.c | 7 +- src/battle/area/jan2/stage/jan_03b.c | 7 +- src/battle/area/jan2/stage/jan_04.c | 7 +- src/battle/area/jan2/stage/jan_04b.c | 7 +- src/battle/area/kgr/actor/fuzzipede.c | 61 +- src/battle/area/kgr/area.c | 21 +- src/battle/area/kgr/area.h | 6 + src/battle/area/kgr/stage/kgr_01.c | 68 +- src/battle/area/kkj/actor/kammy_koopa.c | 15 +- src/battle/area/kkj/area.c | 21 +- src/battle/area/kkj/area.h | 6 + src/battle/area/kkj/stage/kpa_05.c | 7 +- src/battle/area/kmr_part_1/actor/goomba.c | 4 +- src/battle/area/kmr_part_1/actor/paragoomba.c | 4 +- .../area/kmr_part_1/actor/spiked_goomba.c | 4 +- src/battle/area/kmr_part_1/area.c | 137 +- src/battle/area/kmr_part_1/area.h | 6 + src/battle/area/kmr_part_1/stage/kmr_02.c | 7 +- src/battle/area/kmr_part_1/stage/kmr_03.c | 7 +- src/battle/area/kmr_part_1/stage/kmr_04.c | 7 +- src/battle/area/kmr_part_1/stage/kmr_05.c | 7 +- src/battle/area/kmr_part_1/stage/kmr_06.c | 7 +- .../area/kmr_part_2/actor/blue_goomba_1.c | 42 +- .../area/kmr_part_2/actor/blue_goomba_2.c | 42 +- .../area/kmr_part_2/actor/goomba_king.c | 43 +- .../area/kmr_part_2/actor/goomnut_tree.c | 6 +- .../area/kmr_part_2/actor/red_goomba_1.c | 42 +- .../area/kmr_part_2/actor/red_goomba_2.c | 42 +- src/battle/area/kmr_part_2/area.c | 74 +- src/battle/area/kmr_part_2/area.h | 6 + src/battle/area/kmr_part_2/stage/kmr_02.c | 7 +- src/battle/area/kmr_part_2/stage/kmr_03.c | 7 +- src/battle/area/kmr_part_2/stage/kmr_04.c | 7 +- src/battle/area/kmr_part_2/stage/kmr_05.c | 7 +- src/battle/area/kmr_part_2/stage/kmr_06.c | 7 +- .../area/kmr_part_3/actor/egg_jr_troopa.c | 40 +- .../area/kmr_part_3/actor/final_jr_troopa.c | 10 +- src/battle/area/kmr_part_3/actor/jr_troopa.c | 23 +- .../area/kmr_part_3/actor/mage_jr_troopa.c | 41 +- .../area/kmr_part_3/actor/para_jr_troopa.c | 42 +- src/battle/area/kmr_part_3/actor/paragoomba.c | 996 +---------- .../area/kmr_part_3/actor/paragoomba2.c | 5 - .../kmr_part_3/actor/spiked_para_jr_troopa.c | 39 +- .../kmr_part_3/actor/tutorial_paragoomba.c | 994 +++++++++++ ...iked_goomba.c => tutorial_spiked_goomba.c} | 47 +- src/battle/area/kmr_part_3/area.c | 107 +- src/battle/area/kmr_part_3/area.h | 6 + src/battle/area/kmr_part_3/stage/kmr_02.c | 7 +- src/battle/area/kmr_part_3/stage/kmr_03.c | 7 +- src/battle/area/kmr_part_3/stage/kmr_04.c | 7 +- src/battle/area/kmr_part_3/stage/kmr_05b.c | 3 + src/battle/area/kmr_part_3/stage/kmr_06.c | 7 +- src/battle/area/kmr_part_3/stage/kpa_13.c | 3 + src/battle/area/kmr_part_3/stage/mac_01.c | 44 +- src/battle/area/kmr_part_3/stage/mim_01.c | 29 +- src/battle/area/kmr_part_3/stage/nok_01.c | 7 +- src/battle/area/kmr_part_3/stage/sam_01.c | 53 +- src/battle/area/kpa/actor/bony_beetle.c | 1163 +------------ src/battle/area/kpa/actor/dry_bones.c | 550 +----- src/battle/area/kpa/actor/ember.c | 4 +- src/battle/area/kpa/actor/hammer_bro.c | 4 +- src/battle/area/kpa/actor/koopatrol.c | 4 +- src/battle/area/kpa/actor/magikoopa.c | 4 +- src/battle/area/kpa/area.c | 671 ++++---- src/battle/area/kpa/area.h | 6 + src/battle/area/kpa/stage/kpa_01.c | 57 +- src/battle/area/kpa/stage/kpa_01b.c | 54 +- src/battle/area/kpa/stage/kpa_02.c | 105 +- src/battle/area/kpa/stage/kpa_03.c | 34 +- src/battle/area/kpa/stage/kpa_04.c | 54 +- src/battle/area/kpa/stage/kpa_04b.c | 53 +- src/battle/area/kpa/stage/kpa_04c.c | 54 +- src/battle/area/kpa/stage/kpa_05.c | 32 +- src/battle/area/kpa/stage/kpa_07.c | 100 +- src/battle/area/kpa/stage/kpa_08.c | 32 +- src/battle/area/kpa/stage/kpa_09.c | 32 +- src/battle/area/kpa/stage/kpa_11.c | 32 +- src/battle/area/kpa/stage/kpa_13.c | 40 +- src/battle/area/kpa/stage/kpa_14.c | 40 +- src/battle/area/kpa2/actor/bowser.c | 19 +- src/battle/area/kpa2/actor/bowser_intro.c | 23 +- src/battle/area/kpa2/actor/bowser_phase_1.c | 33 +- src/battle/area/kpa2/actor/bowser_phase_2.c | 29 +- src/battle/area/kpa2/actor/bowser_phase_3.c | 31 +- src/battle/area/kpa2/area.c | 63 +- src/battle/area/kpa2/area.h | 6 + src/battle/area/kpa2/stage/kkj_01.c | 3 + src/battle/area/kpa2/stage/kkj_02.c | 3 + src/battle/area/kpa2/stage/kpa_01.c | 58 +- src/battle/area/kpa2/stage/kpa_03.c | 6 - src/battle/area/kpa3/actor/anti_guy.c | 499 +----- src/battle/area/kpa3/actor/duplighost.c | 4 +- src/battle/area/kpa3/area.c | 47 +- src/battle/area/kpa3/area.h | 6 + src/battle/area/kpa3/stage/kpa_01.c | 57 +- src/battle/area/kpa4/actor/bombshell_bill.c | 24 +- .../area/kpa4/actor/bombshell_bill_blaster.c | 22 +- src/battle/area/kpa4/actor/koopatrol.c | 4 +- src/battle/area/kpa4/actor/magikoopa.c | 4 +- src/battle/area/kpa4/area.c | 125 +- src/battle/area/kpa4/area.h | 6 + src/battle/area/kpa4/stage/kpa_01.c | 57 +- src/battle/area/kpa4/stage/kpa_01b.c | 54 +- src/battle/area/kpa4/stage/kpa_02.c | 105 +- src/battle/area/kpa4/stage/kpa_03.c | 34 +- src/battle/area/kpa4/stage/kpa_04.c | 54 +- src/battle/area/kpa4/stage/kpa_04b.c | 53 +- src/battle/area/kpa4/stage/kpa_04c.c | 54 +- src/battle/area/kpa4/stage/kpa_05.c | 32 +- src/battle/area/kpa4/stage/kpa_07.c | 100 +- src/battle/area/kpa4/stage/kpa_08.c | 32 +- src/battle/area/kpa4/stage/kpa_09.c | 32 +- src/battle/area/kpa4/stage/kpa_11.c | 32 +- src/battle/area/kpa4/stage/kpa_13.c | 40 +- src/battle/area/kpa4/stage/kpa_14.c | 40 +- src/battle/area/kzn/actor/lava_bubble.c | 687 +------- src/battle/area/kzn/actor/medi_guy.c | 8 +- src/battle/area/kzn/actor/putrid_piranha.c | 4 +- src/battle/area/kzn/actor/red_magikoopa.c | 2 +- src/battle/area/kzn/actor/spike_top.c | 4 +- src/battle/area/kzn/actor/white_magikoopa.c | 4 +- src/battle/area/kzn/area.c | 259 ++- src/battle/area/kzn/area.h | 6 + src/battle/area/kzn/stage/kzn_01.c | 36 +- src/battle/area/kzn/stage/kzn_01b.c | 35 +- src/battle/area/kzn/stage/kzn_02.c | 123 +- src/battle/area/kzn/stage/kzn_04.c | 129 +- src/battle/area/kzn/stage/kzn_04b.c | 129 +- src/battle/area/kzn/stage/kzn_04c.c | 123 +- src/battle/area/kzn/stage/kzn_05.c | 166 +- src/battle/area/kzn2/actor/lava_bud.c | 33 +- src/battle/area/kzn2/actor/lava_piranha.c | 51 +- src/battle/area/kzn2/actor/petit_piranha.c | 36 +- .../area/kzn2/actor/petit_piranha_bomb.c | 6 +- .../area/kzn2/anim/lava_piranha_anim1.inc.c | 4 +- .../area/kzn2/anim/lava_piranha_anim2.inc.c | 4 +- .../area/kzn2/anim/lava_piranha_anim3.inc.c | 4 +- .../area/kzn2/anim/lava_piranha_anim4.inc.c | 4 +- src/battle/area/kzn2/area.c | 63 +- src/battle/area/kzn2/area.h | 6 + src/battle/area/kzn2/stage/kzn_01.c | 36 +- src/battle/area/kzn2/stage/kzn_01b.c | 35 +- src/battle/area/kzn2/stage/kzn_02.c | 123 +- src/battle/area/kzn2/stage/kzn_04.c | 129 +- src/battle/area/kzn2/stage/kzn_04b.c | 129 +- src/battle/area/kzn2/stage/kzn_04c.c | 123 +- src/battle/area/kzn2/stage/kzn_05.c | 166 +- src/battle/area/mac/actor/chan.c | 110 +- src/battle/area/mac/actor/lee.c | 378 ++--- src/battle/area/mac/actor/master1.c | 46 +- src/battle/area/mac/actor/master2.c | 12 +- src/battle/area/mac/actor/master3.c | 46 +- src/battle/area/mac/area.c | 58 +- src/battle/area/mac/area.h | 6 + src/battle/area/mac/stage/mac_01.c | 44 +- src/battle/area/mac/stage/mac_02.c | 29 +- src/battle/area/mim/actor/bzzap.c | 4 +- src/battle/area/mim/actor/forest_fuzzy.c | 666 +------- src/battle/area/mim/actor/piranha_plant.c | 376 +--- src/battle/area/mim/area.c | 196 ++- src/battle/area/mim/area.h | 6 + src/battle/area/mim/stage/mim_01.c | 28 +- src/battle/area/nok/actor/fuzzy.c | 4 +- src/battle/area/nok/actor/goomba.c | 4 +- src/battle/area/nok/actor/kent_c_koopa.c | 513 +++--- src/battle/area/nok/actor/koopa_troopa.c | 4 +- src/battle/area/nok/actor/paragoomba.c | 4 +- src/battle/area/nok/actor/paratroopa.c | 4 +- src/battle/area/nok/actor/spiked_goomba.c | 4 +- src/battle/area/nok/area.c | 268 ++- src/battle/area/nok/area.h | 6 + src/battle/area/nok/stage/nok_01.c | 7 +- src/battle/area/nok/stage/nok_02.c | 84 +- src/battle/area/nok/stage/nok_03.c | 33 +- src/battle/area/nok/stage/nok_04.c | 36 +- src/battle/area/omo/actor/anti_guy.c | 498 +----- src/battle/area/omo/actor/blue_shy_guy.c | 499 +----- src/battle/area/omo/actor/green_shy_guy.c | 499 +----- src/battle/area/omo/actor/groove_guy.c | 835 +-------- src/battle/area/omo/actor/medi_guy.c | 8 +- src/battle/area/omo/actor/pink_shy_guy.c | 499 +----- src/battle/area/omo/actor/pyro_guy.c | 332 +--- src/battle/area/omo/actor/red_shy_guy.c | 4 +- src/battle/area/omo/actor/sky_guy.c | 1014 +---------- src/battle/area/omo/actor/spy_guy.c | 624 +------ src/battle/area/omo/actor/yellow_shy_guy.c | 500 +----- src/battle/area/omo/area.c | 504 +++--- src/battle/area/omo/area.h | 6 + src/battle/area/omo/stage/omo_01.c | 104 +- src/battle/area/omo/stage/omo_02.c | 26 +- src/battle/area/omo/stage/omo_03.c | 27 +- src/battle/area/omo/stage/omo_03b.c | 26 +- src/battle/area/omo/stage/omo_04.c | 65 +- src/battle/area/omo/stage/omo_05.c | 36 +- src/battle/area/omo/stage/omo_05b.c | 35 +- src/battle/area/omo/stage/omo_06.c | 73 +- src/battle/area/omo/stage/omo_07.c | 25 +- src/battle/area/omo2/actor/general_guy.c | 33 +- src/battle/area/omo2/actor/light_bulb.c | 1 - src/battle/area/omo2/actor/toy_tank.c | 13 +- src/battle/area/omo2/area.c | 29 +- src/battle/area/omo2/area.h | 6 + src/battle/area/omo2/stage/omo_07.c | 25 +- src/battle/area/omo2_1/actor/shy_squad.c | 13 +- src/battle/area/omo2_2/actor/stilt_guy.c | 75 +- src/battle/area/omo2_3/actor/shy_stack.c | 47 +- src/battle/area/omo2_4/actor/signal_guy.c | 7 +- src/battle/area/omo2_5/actor/shy_squad_dup.c | 15 +- src/battle/area/omo2_6/actor/shy_guy_dup.c | 1 - .../area/omo3/actor/big_lantern_ghost.c | 47 +- src/battle/area/omo3/actor/clubba.c | 4 +- src/battle/area/omo3/actor/fuzzy.c | 4 +- src/battle/area/omo3/actor/goomba.c | 4 +- src/battle/area/omo3/actor/hammer_bro.c | 4 +- src/battle/area/omo3/actor/koopatrol.c | 4 +- src/battle/area/omo3/actor/pokey.c | 4 +- src/battle/area/omo3/actor/red_shy_guy.c | 4 +- src/battle/area/omo3/area.c | 148 +- src/battle/area/omo3/area.h | 6 + src/battle/area/omo3/stage/omo_01.c | 104 +- src/battle/area/omo3/stage/omo_02.c | 26 +- src/battle/area/omo3/stage/omo_03.c | 27 +- src/battle/area/omo3/stage/omo_03b.c | 26 +- src/battle/area/omo3/stage/omo_04.c | 65 +- src/battle/area/omo3/stage/omo_05.c | 36 +- src/battle/area/omo3/stage/omo_05b.c | 35 +- src/battle/area/omo3/stage/omo_06.c | 73 +- src/battle/area/omo3/stage/omo_07.c | 25 +- src/battle/area/pra/actor/albino_dino.c | 326 +--- src/battle/area/pra/actor/gray_magikoopa.c | 4 +- src/battle/area/pra/actor/green_magikoopa.c | 4 +- src/battle/area/pra/actor/red_magikoopa.c | 20 +- src/battle/area/pra/actor/swoopula.c | 4 +- src/battle/area/pra/actor/white_clubba.c | 4 +- src/battle/area/pra/actor/white_magikoopa.c | 4 +- src/battle/area/pra/actor/yellow_magikoopa.c | 4 +- src/battle/area/pra/area.c | 207 ++- src/battle/area/pra/area.h | 6 + src/battle/area/pra/stage/pra_01.c | 36 +- src/battle/area/pra/stage/pra_02.c | 99 +- src/battle/area/pra/stage/pra_03.c | 25 +- src/battle/area/pra/stage/pra_03b.c | 26 +- src/battle/area/pra/stage/pra_03c.c | 27 +- src/battle/area/pra/stage/pra_04.c | 91 +- src/battle/area/pra2/actor/crystal_bit.c | 25 +- src/battle/area/pra2/actor/crystal_king.c | 71 +- src/battle/area/pra2/area.c | 43 +- src/battle/area/pra2/area.h | 6 + src/battle/area/pra2/stage/sam_04.c | 33 +- src/battle/area/pra3/actor/duplighost.c | 4 +- src/battle/area/pra3/actor/gray_magikoopa.c | 4 +- src/battle/area/pra3/actor/red_magikoopa.c | 2 +- src/battle/area/pra3/actor/swoopula.c | 4 +- src/battle/area/pra3/actor/white_clubba.c | 4 +- src/battle/area/pra3/area.c | 161 +- src/battle/area/pra3/area.h | 6 + src/battle/area/pra3/stage/pra_01.c | 36 +- src/battle/area/pra3/stage/pra_02.c | 99 +- src/battle/area/pra3/stage/pra_03.c | 25 +- src/battle/area/pra3/stage/pra_03b.c | 26 +- src/battle/area/pra3/stage/pra_03c.c | 27 +- src/battle/area/pra3/stage/pra_04.c | 90 +- src/battle/area/sam/actor/duplighost.c | 4 +- src/battle/area/sam/actor/frost_piranha.c | 487 +----- src/battle/area/sam/actor/gray_magikoopa.c | 4 +- src/battle/area/sam/actor/gulpit.c | 497 +----- src/battle/area/sam/actor/gulpit_rocks.c | 191 +-- src/battle/area/sam/actor/white_clubba.c | 4 +- src/battle/area/sam/area.c | 283 ++- src/battle/area/sam/area.h | 6 + src/battle/area/sam/stage/sam_01.c | 54 +- src/battle/area/sam/stage/sam_02.c | 56 +- src/battle/area/sam/stage/sam_02b.c | 39 +- src/battle/area/sam/stage/sam_02c.c | 40 +- src/battle/area/sam/stage/sam_02d.c | 41 +- src/battle/area/sam/stage/sam_03.c | 58 +- src/battle/area/sam2/actor/gray_magikoopa.c | 4 +- src/battle/area/sam2/actor/monstar.c | 33 +- src/battle/area/sam2/actor/paragoomba.c | 4 +- src/battle/area/sam2/area.c | 55 +- src/battle/area/sam2/area.h | 6 + src/battle/area/sam2/dlist.c | 4 +- src/battle/area/sam2/stage/sam_01.c | 54 +- src/battle/area/sam2/stage/sam_02.c | 56 +- src/battle/area/sam2/stage/sam_02b.c | 39 +- src/battle/area/sam2/stage/sam_02c.c | 40 +- src/battle/area/sam2/stage/sam_02d.c | 41 +- src/battle/area/sam2/stage/sam_03.c | 58 +- src/battle/area/sam2/vtx.c | 4 +- src/battle/area/sbk/actor/bandit.c | 4 +- src/battle/area/sbk/actor/pokey.c | 4 +- src/battle/area/sbk/area.c | 181 +- src/battle/area/sbk/area.h | 6 + src/battle/area/sbk/stage/sbk_02.c | 68 +- src/battle/area/tik/actor/buzzy_beetle.c | 4 +- src/battle/area/tik/actor/dark_koopa.c | 892 +--------- src/battle/area/tik/actor/dark_paratroopa.c | 1444 +--------------- src/battle/area/tik/actor/gloomba.c | 461 +---- src/battle/area/tik/actor/paragloomba.c | 935 +--------- src/battle/area/tik/actor/spike_top.c | 4 +- src/battle/area/tik/actor/spiked_gloomba.c | 483 +----- src/battle/area/tik/actor/spiny.c | 4 +- src/battle/area/tik/area.c | 295 ++-- src/battle/area/tik/area.h | 6 + src/battle/area/tik/stage/tik_01.c | 228 +-- src/battle/area/tik/stage/tik_02.c | 228 +-- src/battle/area/tik/stage/tik_03.c | 171 +- src/battle/area/tik/stage/tik_04.c | 54 +- src/battle/area/tik/stage/tik_05.c | 53 +- src/battle/area/tik2/actor/blooper.c | 32 +- src/battle/area/tik2/actor/blooper_baby.c | 33 +- src/battle/area/tik2/actor/electro_blooper.c | 35 +- src/battle/area/tik2/actor/super_blooper.c | 48 +- src/battle/area/tik2/area.c | 55 +- src/battle/area/tik2/area.h | 6 + src/battle/area/tik2/stage/tik_01.c | 228 +-- src/battle/area/tik2/stage/tik_02.c | 228 +-- src/battle/area/tik2/stage/tik_03.c | 171 +- src/battle/area/tik2/stage/tik_04.c | 54 +- src/battle/area/tik2/stage/tik_05.c | 53 +- src/battle/area/tik3/actor/swooper.c | 4 +- src/battle/area/tik3/actor/swoopula.c | 4 +- src/battle/area/tik3/area.c | 69 +- src/battle/area/tik3/area.h | 6 + src/battle/area/tik3/stage/tik_01.c | 228 +-- src/battle/area/tik3/stage/tik_02.c | 228 +-- src/battle/area/tik3/stage/tik_03.c | 171 +- src/battle/area/tik3/stage/tik_04.c | 54 +- src/battle/area/tik3/stage/tik_05.c | 53 +- .../area/trd_part_1/actor/bill_blaster.c | 250 +-- src/battle/area/trd_part_1/actor/bob_omb.c | 700 +------- .../area/trd_part_1/actor/bullet_bill.c | 312 +--- .../area/trd_part_1/actor/koopa_troopa.c | 2 - src/battle/area/trd_part_1/actor/paratroopa.c | 2 - src/battle/area/trd_part_1/stage/trd_00.c | 2 +- src/battle/area/trd_part_1/stage/trd_01.c | 2 +- src/battle/area/trd_part_1/stage/trd_02.c | 2 +- src/battle/area/trd_part_1/stage/trd_02b.c | 2 +- src/battle/area/trd_part_1/stage/trd_02c.c | 2 +- src/battle/area/trd_part_1/stage/trd_02d.c | 2 +- src/battle/area/trd_part_1/stage/trd_03.c | 2 +- src/battle/area/trd_part_1/stage/trd_04.c | 2 +- src/battle/area/trd_part_1/stage/trd_05.c | 2 +- src/battle/area/trd_part_1/stage/trd_05b.c | 2 +- src/battle/area/trd_part_1/stage/trd_05c.c | 2 +- src/battle/area/trd_part_1/stage/trd_05d.c | 2 +- src/battle/area/trd_part_1/stage/trd_05e.c | 2 +- src/battle/area/trd_part_1/stage/trd_05f.c | 2 +- src/battle/area/trd_part_2/area.c | 3 - src/battle/area/trd_part_2/stage/trd_00.c | 2 +- src/battle/area/trd_part_2/stage/trd_01.c | 2 +- src/battle/area/trd_part_2/stage/trd_02.c | 2 +- src/battle/area/trd_part_2/stage/trd_02b.c | 2 +- src/battle/area/trd_part_2/stage/trd_03.c | 2 +- src/battle/area/trd_part_2/stage/trd_04.c | 2 +- src/battle/area/trd_part_2/stage/trd_05.c | 2 +- src/battle/area/trd_part_2/stage/trd_05b.c | 2 +- src/battle/area/trd_part_2/stage/trd_05c.c | 2 +- src/battle/area/trd_part_2/stage/trd_05d.c | 2 +- src/battle/area/trd_part_2/stage/trd_05e.c | 2 +- src/battle/area/trd_part_2/stage/trd_05f.c | 2 +- src/battle/area/trd_part_3/area.c | 3 - src/battle/area/trd_part_3/stage/nok_01.c | 4 +- src/battle/battle.h | 4 +- src/battle/battle_tables.h | 1 - src/battle/common/actor/albino_dino.inc.c | 338 ++++ src/battle/common/actor/amazy_dayzee.inc.c | 378 +++++ src/battle/common/actor/anti_guy.inc.c | 508 ++++++ src/battle/common/actor/bandit.inc.c | 310 ++-- src/battle/common/actor/bill_blaster.inc.c | 254 +++ src/battle/common/actor/blue_shy_guy.inc.c | 497 ++++++ src/battle/common/actor/bob_omb.inc.c | 702 ++++++++ src/battle/common/actor/bony_beetle.inc.c | 1161 +++++++++++++ src/battle/common/actor/bullet_bill.inc.c | 316 ++++ src/battle/common/actor/buzzy_beetle.inc.c | 100 +- src/battle/common/actor/bzzap.inc.c | 39 +- src/battle/common/actor/cleft.inc.c | 552 ++++++ src/battle/common/actor/clubba.inc.c | 45 +- src/battle/common/actor/crazee_dayzee.inc.c | 389 +++++ src/battle/common/actor/dark_koopa.inc.c | 890 ++++++++++ src/battle/common/actor/dark_paratroopa.inc.c | 1442 ++++++++++++++++ src/battle/common/actor/dry_bones.inc.c | 548 ++++++ src/battle/common/actor/duplighost.inc.c | 73 +- .../{ => duplighost}/ghost_bombette.inc.c | 37 +- .../actor/{ => duplighost}/ghost_bow.inc.c | 37 +- .../{ => duplighost}/ghost_goombario.inc.c | 37 +- .../actor/{ => duplighost}/ghost_kooper.inc.c | 39 +- .../{ => duplighost}/ghost_lakilester.inc.c | 39 +- .../{ => duplighost}/ghost_parakarry.inc.c | 37 +- .../actor/{ => duplighost}/ghost_sushie.inc.c | 37 +- .../actor/{ => duplighost}/ghost_watt.inc.c | 29 +- src/battle/common/actor/ember.inc.c | 49 +- src/battle/common/actor/forest_fuzzy.inc.c | 663 ++++++++ src/battle/common/actor/frost_piranha.inc.c | 485 ++++++ src/battle/common/actor/fuzzy.inc.c | 87 +- src/battle/common/actor/gloomba.inc.c | 459 +++++ src/battle/common/actor/goomba.inc.c | 170 +- src/battle/common/actor/gray_magikoopa.inc.c | 57 +- src/battle/common/actor/green_magikoopa.inc.c | 57 +- src/battle/common/actor/green_shy_guy.inc.c | 497 ++++++ src/battle/common/actor/groove_guy.inc.c | 833 +++++++++ src/battle/common/actor/gulpit.inc.c | 495 ++++++ src/battle/common/actor/gulpit_rocks.inc.c | 189 +++ src/battle/common/actor/hammer_bro.inc.c | 33 +- src/battle/common/actor/hurt_plant.inc.c | 351 ++++ src/battle/common/actor/hyper_cleft.inc.c | 842 +++++++++ .../actor/hyper_goomba.inc.c} | 42 +- .../common/actor/hyper_paragoomba.inc.c | 1496 ++++++++++++++++ src/battle/common/actor/jungle_fuzzy.inc.c | 838 +++++++++ src/battle/common/actor/koopa_troopa.inc.c | 289 ++-- src/battle/common/actor/koopatrol.inc.c | 85 +- src/battle/common/actor/lakitu.inc.c | 609 +++++++ src/battle/common/actor/lava_bubble.inc.c | 685 ++++++++ src/battle/common/actor/m_bush.inc.c | 298 ++++ src/battle/common/actor/magikoopa.inc.c | 77 +- src/battle/common/actor/medi_guy.inc.c | 38 +- src/battle/common/actor/monty_mole.inc.c | 25 +- src/battle/common/actor/paragloomba.inc.c | 933 ++++++++++ src/battle/common/actor/paragoomba.inc.c | 681 ++------ src/battle/common/actor/paratroopa.inc.c | 692 ++++---- src/battle/common/actor/pink_shy_guy.inc.c | 497 ++++++ src/battle/common/actor/piranha_plant.inc.c | 373 ++++ src/battle/common/actor/pokey.inc.c | 988 +++++------ src/battle/common/actor/pokey_mummy.inc.c | 1014 +++++++++++ src/battle/common/actor/putrid_piranha.inc.c | 37 +- src/battle/common/actor/pyro_guy.inc.c | 331 ++++ src/battle/common/actor/red_magikoopa.inc.c | 57 +- src/battle/common/actor/red_shy_guy.inc.c | 47 +- src/battle/common/actor/ruff_puff.inc.c | 346 ++++ src/battle/common/actor/sky_guy.inc.c | 1013 +++++++++++ src/battle/common/actor/slot_machine.inc.c | 3 +- src/battle/common/actor/spear_guy.inc.c | 1509 ++++++++++++++++ src/battle/common/actor/spike_top.inc.c | 100 +- src/battle/common/actor/spiked_gloomba.inc.c | 481 ++++++ src/battle/common/actor/spiked_goomba.inc.c | 169 +- src/battle/common/actor/spiny.inc.c | 50 +- src/battle/common/actor/spy_guy.inc.c | 623 +++++++ src/battle/common/actor/stone_chomp.inc.c | 769 +++++++++ src/battle/common/actor/swooper.inc.c | 69 +- src/battle/common/actor/swoopula.inc.c | 69 +- src/battle/common/actor/whacka.inc.c | 47 +- src/battle/common/actor/white_clubba.inc.c | 45 +- src/battle/common/actor/white_magikoopa.inc.c | 57 +- .../common/actor/yellow_magikoopa.inc.c | 57 +- src/battle/common/actor/yellow_shy_guy.inc.c | 498 ++++++ src/battle/common/stage/area_arn/arn_01.inc.c | 31 + src/battle/common/stage/area_arn/arn_02.inc.c | 48 + src/battle/common/stage/area_arn/arn_03.inc.c | 31 + src/battle/common/stage/area_arn/arn_04.inc.c | 30 + src/battle/common/stage/area_arn/arn_05.inc.c | 30 + src/battle/common/stage/area_arn/arn_06.inc.c | 29 + src/battle/common/stage/area_dgb/dgb_01.inc.c | 23 + src/battle/common/stage/area_dgb/dgb_02.inc.c | 23 + src/battle/common/stage/area_dgb/dgb_03.inc.c | 23 + src/battle/common/stage/area_dgb/dgb_04.inc.c | 29 + src/battle/common/stage/area_dgb/dgb_05.inc.c | 23 + .../common/stage/{ => area_flo}/flo_01.inc.c | 11 +- .../common/stage/{ => area_flo}/flo_01b.inc.c | 5 +- .../common/stage/{ => area_flo}/flo_01c.inc.c | 5 +- .../common/stage/{ => area_flo}/flo_02.inc.c | 5 +- .../common/stage/{ => area_flo}/flo_02b.inc.c | 5 +- .../common/stage/{ => area_flo}/flo_02c.inc.c | 5 +- .../common/stage/{ => area_flo}/flo_03.inc.c | 3 +- .../common/stage/{ => area_flo}/flo_04.inc.c | 3 +- .../common/stage/{ => area_flo}/flo_05.inc.c | 3 +- .../common/stage/{ => area_flo}/flo_06.inc.c | 3 +- src/battle/common/stage/area_hos/hos_00.inc.c | 81 + src/battle/common/stage/area_hos/hos_01.inc.c | 267 +++ src/battle/common/stage/area_hos/hos_02.inc.c | 102 ++ .../common/stage/{ => area_isk}/isk_00.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_01.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_02.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_02b.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_02c.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_03.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_03b.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_04.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_05.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_06.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_06b.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_07.inc.c | 3 +- .../common/stage/{ => area_isk}/isk_08.inc.c | 3 +- src/battle/common/stage/area_iwa/iwa_01.inc.c | 51 + .../common/stage/area_iwa/iwa_01b.inc.c | 32 + src/battle/common/stage/area_iwa/iwa_02.inc.c | 46 + .../common/stage/{ => area_jan}/jan_00.inc.c | 5 +- .../common/stage/{ => area_jan}/jan_01.inc.c | 5 +- .../common/stage/{ => area_jan}/jan_01b.inc.c | 5 +- .../common/stage/{ => area_jan}/jan_02.inc.c | 3 +- .../common/stage/{ => area_jan}/jan_03.inc.c | 3 +- .../common/stage/{ => area_jan}/jan_03b.inc.c | 3 +- .../common/stage/{ => area_jan}/jan_04.inc.c | 3 +- .../common/stage/{ => area_jan}/jan_04b.inc.c | 3 +- src/battle/common/stage/area_kgr/kgr_01.inc.c | 66 + .../stage/area_kkj/kkj_01.inc.c} | 3 +- .../common/stage/{ => area_kkj}/kkj_02.inc.c | 3 +- .../common/stage/{ => area_kmr}/kmr_02.inc.c | 3 +- .../common/stage/{ => area_kmr}/kmr_03.inc.c | 7 +- .../common/stage/{ => area_kmr}/kmr_04.inc.c | 7 +- .../common/stage/{ => area_kmr}/kmr_05.inc.c | 3 +- .../stage/area_kmr/kmr_05b.inc.c} | 3 +- .../common/stage/{ => area_kmr}/kmr_06.inc.c | 17 +- src/battle/common/stage/area_kpa/kpa_01.inc.c | 56 + .../common/stage/area_kpa/kpa_01b.inc.c | 53 + src/battle/common/stage/area_kpa/kpa_02.inc.c | 52 + src/battle/common/stage/area_kpa/kpa_03.inc.c | 32 + src/battle/common/stage/area_kpa/kpa_04.inc.c | 54 + .../common/stage/area_kpa/kpa_04b.inc.c | 53 + .../common/stage/area_kpa/kpa_04c.inc.c | 54 + src/battle/common/stage/area_kpa/kpa_05.inc.c | 30 + src/battle/common/stage/area_kpa/kpa_07.inc.c | 47 + src/battle/common/stage/area_kpa/kpa_08.inc.c | 30 + src/battle/common/stage/area_kpa/kpa_09.inc.c | 30 + src/battle/common/stage/area_kpa/kpa_11.inc.c | 30 + .../stage/area_kpa/kpa_13.inc.c} | 6 +- src/battle/common/stage/area_kpa/kpa_14.inc.c | 40 + .../common/stage/area_kzn/Decorations.inc.c | 65 + src/battle/common/stage/area_kzn/kzn_01.inc.c | 35 + .../common/stage/area_kzn/kzn_01b.inc.c | 34 + src/battle/common/stage/area_kzn/kzn_02.inc.c | 60 + src/battle/common/stage/area_kzn/kzn_04.inc.c | 66 + .../common/stage/area_kzn/kzn_04b.inc.c | 66 + .../common/stage/area_kzn/kzn_04c.inc.c | 60 + src/battle/common/stage/area_kzn/kzn_05.inc.c | 103 ++ src/battle/common/stage/area_mac/mac_01.inc.c | 42 + src/battle/common/stage/area_mac/mac_02.inc.c | 27 + src/battle/common/stage/area_mim/mim_01.inc.c | 35 + .../common/stage/{ => area_nok}/nok_01.inc.c | 3 +- src/battle/common/stage/area_nok/nok_02.inc.c | 82 + src/battle/common/stage/area_nok/nok_03.inc.c | 31 + src/battle/common/stage/area_nok/nok_04.inc.c | 34 + src/battle/common/stage/area_omo/omo_01.inc.c | 105 ++ src/battle/common/stage/area_omo/omo_02.inc.c | 25 + src/battle/common/stage/area_omo/omo_03.inc.c | 26 + .../common/stage/area_omo/omo_03b.inc.c | 25 + src/battle/common/stage/area_omo/omo_04.inc.c | 63 + src/battle/common/stage/area_omo/omo_05.inc.c | 34 + .../common/stage/area_omo/omo_05b.inc.c | 33 + src/battle/common/stage/area_omo/omo_06.inc.c | 71 + src/battle/common/stage/area_omo/omo_07.inc.c | 23 + src/battle/common/stage/area_pra/pra_01.inc.c | 34 + src/battle/common/stage/area_pra/pra_02.inc.c | 46 + src/battle/common/stage/area_pra/pra_03.inc.c | 24 + .../common/stage/area_pra/pra_03b.inc.c | 25 + .../common/stage/area_pra/pra_03c.inc.c | 26 + src/battle/common/stage/area_pra/pra_04.inc.c | 38 + src/battle/common/stage/area_sam/sam_01.inc.c | 52 + src/battle/common/stage/area_sam/sam_02.inc.c | 54 + .../common/stage/area_sam/sam_02b.inc.c | 37 + .../common/stage/area_sam/sam_02c.inc.c | 38 + .../common/stage/area_sam/sam_02d.inc.c | 39 + src/battle/common/stage/area_sam/sam_03.inc.c | 56 + src/battle/common/stage/area_sam/sam_04.inc.c | 31 + src/battle/common/stage/area_sbk/sbk_02.inc.c | 112 ++ src/battle/common/stage/area_tik/tik_01.inc.c | 50 + src/battle/common/stage/area_tik/tik_02.inc.c | 50 + src/battle/common/stage/area_tik/tik_03.inc.c | 44 + src/battle/common/stage/area_tik/tik_04.inc.c | 53 + src/battle/common/stage/area_tik/tik_05.inc.c | 51 + .../common/stage/{ => area_trd}/trd_00.inc.c | 1 - .../common/stage/{ => area_trd}/trd_01.inc.c | 1 - .../common/stage/{ => area_trd}/trd_02.inc.c | 1 - .../common/stage/{ => area_trd}/trd_02b.inc.c | 1 - .../common/stage/{ => area_trd}/trd_02c.inc.c | 1 - .../common/stage/{ => area_trd}/trd_02d.inc.c | 1 - .../common/stage/{ => area_trd}/trd_03.inc.c | 1 - .../common/stage/{ => area_trd}/trd_04.inc.c | 1 - .../common/stage/{ => area_trd}/trd_05.inc.c | 1 - .../common/stage/{ => area_trd}/trd_05b.inc.c | 1 - .../common/stage/{ => area_trd}/trd_05c.inc.c | 1 - .../common/stage/{ => area_trd}/trd_05d.inc.c | 1 - .../common/stage/{ => area_trd}/trd_05e.inc.c | 1 - .../common/stage/{ => area_trd}/trd_05f.inc.c | 1 - src/battle/common/stage/lib/DripVolumes.inc.c | 230 +++ src/battle/common/stage/lib/Snowflakes.inc.c | 2 +- .../common/stage/lib/TexturePanner.inc.c | 9 +- .../common/stage/lib/WaterEffects.inc.c | 13 +- src/battle/move/star_power/up_and_away.c | 1 - src/battle/partner/bombette.c | 10 +- src/battle/partner/bow.c | 9 +- src/battle/partner/goombario.c | 8 +- src/battle/partner/goompa.c | 11 +- src/battle/partner/kooper.c | 12 +- src/battle/partner/lakilester.c | 10 +- src/battle/partner/parakarry.c | 13 +- src/battle/partner/sushie.c | 8 +- src/battle/partner/twink.c | 9 +- src/battle/partner/watt.c | 10 +- src/common/DivActorLevel4.inc.c | 1 - src/common/GetModelPos.inc.c | 12 - src/common/SetSpinSmashable.inc.c | 1 - src/common/UnkFloatFunc005.inc.c | 1 - src/common/UnkFogFunc.inc.c | 8 - src/common/UnkFogFunc2.inc.c | 12 - src/common/UpdateSunPos.inc.c | 39 - src/encounter.c | 1 - src/world/area_jan/jan_11/jan_11_2_main.c | 2 +- .../area_obk/obk_07/obk_07_6_phonograph.c | 4 +- src/world/area_omo/omo_09/omo_09_7_npc.c | 2 +- src/world/area_pra/pra_01/pra_01_2_main.c | 9 +- src/world/area_tik/common/DripVolumes.inc.c | 9 +- src/world/area_tik/tik_01/tik_01_3_drips.c | 1 + src/world/area_tik/tik_02/tik_02_4_drips.c | 1 + src/world/area_tik/tik_03/tik_03_3_drips.c | 1 + src/world/area_tik/tik_04/tik_04_3_drips.c | 1 + src/world/area_tik/tik_05/tik_05_3_drips.c | 1 + src/world/area_tik/tik_06/tik_06_3_drips.c | 1 + src/world/area_tik/tik_07/tik_07_4_drips.c | 1 + src/world/area_tik/tik_08/tik_08_3_drips.c | 1 + src/world/area_tik/tik_09/tik_09_3_drips.c | 1 + src/world/area_tik/tik_10/tik_10_3_drips.c | 1 + src/world/area_tik/tik_12/tik_12_3_drips.c | 1 + src/world/area_tik/tik_14/tik_14_3_drips.c | 1 + src/world/area_tik/tik_15/tik_15_4_drips.c | 1 + src/world/area_tik/tik_18/tik_18_3_drips.c | 1 + src/world/area_tik/tik_20/tik_20_2_main.c | 1 + src/world/area_tik/tik_21/tik_21_2_main.c | 1 + src/world/area_tik/tik_22/tik_22_2_main.c | 1 + src/world/area_tik/tik_23/tik_23_2_main.c | 1 + src/world/area_tik/tik_24/tik_24_3_drips.c | 1 + src/world/area_tik/tik_25/tik_25_2_main.c | 1 + src/world/common/enemy/Bandit.h | 32 +- src/world/common/enemy/Bandit.inc.c | 4 +- src/world/common/enemy/Pokey.h | 32 +- src/world/common/enemy/PokeyMummy.h | 32 +- .../todo/CheckDripCollisionWithNPC.inc.c | 50 - src/world/common/todo/UnkFunc52.inc.c | 1 - src/world/common/todo/UnkFunc56.inc.c | 74 - tools/splat_ext/npc.yaml | 238 +-- ver/pal/splat.yaml | 16 +- ver/pal/undefined_syms.txt | 2 +- ver/us/splat.yaml | 16 +- ver/us/symbol_addrs.txt | 74 +- 803 files changed, 37852 insertions(+), 43779 deletions(-) create mode 100644 src/battle/area/arn/actor/hyper_goomba.c create mode 100644 src/battle/area/arn/area.h create mode 100644 src/battle/area/dgb/area.h create mode 100644 src/battle/area/dig/area.h create mode 100644 src/battle/area/flo/area.h create mode 100644 src/battle/area/flo2/area.h create mode 100644 src/battle/area/hos/area.h create mode 100644 src/battle/area/isk_part_1/area.h create mode 100644 src/battle/area/isk_part_2/area.h create mode 100644 src/battle/area/iwa/area.h create mode 100644 src/battle/area/jan/area.h create mode 100644 src/battle/area/jan2/area.h create mode 100644 src/battle/area/kgr/area.h create mode 100644 src/battle/area/kkj/area.h create mode 100644 src/battle/area/kmr_part_1/area.h create mode 100644 src/battle/area/kmr_part_2/area.h delete mode 100644 src/battle/area/kmr_part_3/actor/paragoomba2.c create mode 100644 src/battle/area/kmr_part_3/actor/tutorial_paragoomba.c rename src/battle/area/kmr_part_3/actor/{spiked_goomba.c => tutorial_spiked_goomba.c} (95%) create mode 100644 src/battle/area/kmr_part_3/area.h create mode 100644 src/battle/area/kmr_part_3/stage/kmr_05b.c create mode 100644 src/battle/area/kmr_part_3/stage/kpa_13.c create mode 100644 src/battle/area/kpa/area.h create mode 100644 src/battle/area/kpa2/area.h create mode 100644 src/battle/area/kpa2/stage/kkj_01.c create mode 100644 src/battle/area/kpa2/stage/kkj_02.c delete mode 100644 src/battle/area/kpa2/stage/kpa_03.c create mode 100644 src/battle/area/kpa3/area.h create mode 100644 src/battle/area/kpa4/area.h create mode 100644 src/battle/area/kzn/area.h create mode 100644 src/battle/area/kzn2/area.h create mode 100644 src/battle/area/mac/area.h create mode 100644 src/battle/area/mim/area.h create mode 100644 src/battle/area/nok/area.h create mode 100644 src/battle/area/omo/area.h create mode 100644 src/battle/area/omo2/area.h create mode 100644 src/battle/area/omo3/area.h create mode 100644 src/battle/area/pra/area.h create mode 100644 src/battle/area/pra2/area.h create mode 100644 src/battle/area/pra3/area.h create mode 100644 src/battle/area/sam/area.h create mode 100644 src/battle/area/sam2/area.h create mode 100644 src/battle/area/sbk/area.h create mode 100644 src/battle/area/tik/area.h create mode 100644 src/battle/area/tik2/area.h create mode 100644 src/battle/area/tik3/area.h create mode 100644 src/battle/common/actor/albino_dino.inc.c create mode 100644 src/battle/common/actor/amazy_dayzee.inc.c create mode 100644 src/battle/common/actor/anti_guy.inc.c create mode 100644 src/battle/common/actor/bill_blaster.inc.c create mode 100644 src/battle/common/actor/blue_shy_guy.inc.c create mode 100644 src/battle/common/actor/bob_omb.inc.c create mode 100644 src/battle/common/actor/bony_beetle.inc.c create mode 100644 src/battle/common/actor/bullet_bill.inc.c create mode 100644 src/battle/common/actor/cleft.inc.c create mode 100644 src/battle/common/actor/crazee_dayzee.inc.c create mode 100644 src/battle/common/actor/dark_koopa.inc.c create mode 100644 src/battle/common/actor/dark_paratroopa.inc.c create mode 100644 src/battle/common/actor/dry_bones.inc.c rename src/battle/common/actor/{ => duplighost}/ghost_bombette.inc.c (94%) rename src/battle/common/actor/{ => duplighost}/ghost_bow.inc.c (95%) rename src/battle/common/actor/{ => duplighost}/ghost_goombario.inc.c (96%) rename src/battle/common/actor/{ => duplighost}/ghost_kooper.inc.c (96%) rename src/battle/common/actor/{ => duplighost}/ghost_lakilester.inc.c (94%) rename src/battle/common/actor/{ => duplighost}/ghost_parakarry.inc.c (94%) rename src/battle/common/actor/{ => duplighost}/ghost_sushie.inc.c (96%) rename src/battle/common/actor/{ => duplighost}/ghost_watt.inc.c (96%) create mode 100644 src/battle/common/actor/forest_fuzzy.inc.c create mode 100644 src/battle/common/actor/frost_piranha.inc.c create mode 100644 src/battle/common/actor/gloomba.inc.c create mode 100644 src/battle/common/actor/green_shy_guy.inc.c create mode 100644 src/battle/common/actor/groove_guy.inc.c create mode 100644 src/battle/common/actor/gulpit.inc.c create mode 100644 src/battle/common/actor/gulpit_rocks.inc.c create mode 100644 src/battle/common/actor/hurt_plant.inc.c create mode 100644 src/battle/common/actor/hyper_cleft.inc.c rename src/battle/{area/arn/actor/hypergoomba.c => common/actor/hyper_goomba.inc.c} (97%) create mode 100644 src/battle/common/actor/hyper_paragoomba.inc.c create mode 100644 src/battle/common/actor/jungle_fuzzy.inc.c create mode 100644 src/battle/common/actor/lakitu.inc.c create mode 100644 src/battle/common/actor/lava_bubble.inc.c create mode 100644 src/battle/common/actor/m_bush.inc.c create mode 100644 src/battle/common/actor/paragloomba.inc.c create mode 100644 src/battle/common/actor/pink_shy_guy.inc.c create mode 100644 src/battle/common/actor/piranha_plant.inc.c create mode 100644 src/battle/common/actor/pokey_mummy.inc.c create mode 100644 src/battle/common/actor/pyro_guy.inc.c create mode 100644 src/battle/common/actor/ruff_puff.inc.c create mode 100644 src/battle/common/actor/sky_guy.inc.c create mode 100644 src/battle/common/actor/spear_guy.inc.c create mode 100644 src/battle/common/actor/spiked_gloomba.inc.c create mode 100644 src/battle/common/actor/spy_guy.inc.c create mode 100644 src/battle/common/actor/stone_chomp.inc.c create mode 100644 src/battle/common/actor/yellow_shy_guy.inc.c create mode 100644 src/battle/common/stage/area_arn/arn_01.inc.c create mode 100644 src/battle/common/stage/area_arn/arn_02.inc.c create mode 100644 src/battle/common/stage/area_arn/arn_03.inc.c create mode 100644 src/battle/common/stage/area_arn/arn_04.inc.c create mode 100644 src/battle/common/stage/area_arn/arn_05.inc.c create mode 100644 src/battle/common/stage/area_arn/arn_06.inc.c create mode 100644 src/battle/common/stage/area_dgb/dgb_01.inc.c create mode 100644 src/battle/common/stage/area_dgb/dgb_02.inc.c create mode 100644 src/battle/common/stage/area_dgb/dgb_03.inc.c create mode 100644 src/battle/common/stage/area_dgb/dgb_04.inc.c create mode 100644 src/battle/common/stage/area_dgb/dgb_05.inc.c rename src/battle/common/stage/{ => area_flo}/flo_01.inc.c (74%) rename src/battle/common/stage/{ => area_flo}/flo_01b.inc.c (92%) rename src/battle/common/stage/{ => area_flo}/flo_01c.inc.c (92%) rename src/battle/common/stage/{ => area_flo}/flo_02.inc.c (91%) rename src/battle/common/stage/{ => area_flo}/flo_02b.inc.c (92%) rename src/battle/common/stage/{ => area_flo}/flo_02c.inc.c (92%) rename src/battle/common/stage/{ => area_flo}/flo_03.inc.c (99%) rename src/battle/common/stage/{ => area_flo}/flo_04.inc.c (98%) rename src/battle/common/stage/{ => area_flo}/flo_05.inc.c (94%) rename src/battle/common/stage/{ => area_flo}/flo_06.inc.c (94%) create mode 100644 src/battle/common/stage/area_hos/hos_00.inc.c create mode 100644 src/battle/common/stage/area_hos/hos_01.inc.c create mode 100644 src/battle/common/stage/area_hos/hos_02.inc.c rename src/battle/common/stage/{ => area_isk}/isk_00.inc.c (93%) rename src/battle/common/stage/{ => area_isk}/isk_01.inc.c (94%) rename src/battle/common/stage/{ => area_isk}/isk_02.inc.c (95%) rename src/battle/common/stage/{ => area_isk}/isk_02b.inc.c (96%) rename src/battle/common/stage/{ => area_isk}/isk_02c.inc.c (95%) rename src/battle/common/stage/{ => area_isk}/isk_03.inc.c (94%) rename src/battle/common/stage/{ => area_isk}/isk_03b.inc.c (93%) rename src/battle/common/stage/{ => area_isk}/isk_04.inc.c (97%) rename src/battle/common/stage/{ => area_isk}/isk_05.inc.c (97%) rename src/battle/common/stage/{ => area_isk}/isk_06.inc.c (96%) rename src/battle/common/stage/{ => area_isk}/isk_06b.inc.c (96%) rename src/battle/common/stage/{ => area_isk}/isk_07.inc.c (96%) rename src/battle/common/stage/{ => area_isk}/isk_08.inc.c (96%) create mode 100644 src/battle/common/stage/area_iwa/iwa_01.inc.c create mode 100644 src/battle/common/stage/area_iwa/iwa_01b.inc.c create mode 100644 src/battle/common/stage/area_iwa/iwa_02.inc.c rename src/battle/common/stage/{ => area_jan}/jan_00.inc.c (90%) rename src/battle/common/stage/{ => area_jan}/jan_01.inc.c (92%) rename src/battle/common/stage/{ => area_jan}/jan_01b.inc.c (92%) rename src/battle/common/stage/{ => area_jan}/jan_02.inc.c (95%) rename src/battle/common/stage/{ => area_jan}/jan_03.inc.c (96%) rename src/battle/common/stage/{ => area_jan}/jan_03b.inc.c (95%) rename src/battle/common/stage/{ => area_jan}/jan_04.inc.c (95%) rename src/battle/common/stage/{ => area_jan}/jan_04b.inc.c (95%) create mode 100644 src/battle/common/stage/area_kgr/kgr_01.inc.c rename src/battle/{area/kpa2/stage/kpa_02.c => common/stage/area_kkj/kkj_01.inc.c} (91%) rename src/battle/common/stage/{ => area_kkj}/kkj_02.inc.c (98%) rename src/battle/common/stage/{ => area_kmr}/kmr_02.inc.c (93%) rename src/battle/common/stage/{ => area_kmr}/kmr_03.inc.c (89%) rename src/battle/common/stage/{ => area_kmr}/kmr_04.inc.c (89%) rename src/battle/common/stage/{ => area_kmr}/kmr_05.inc.c (95%) rename src/battle/{area/kmr_part_3/stage/kmr_05.c => common/stage/area_kmr/kmr_05b.inc.c} (91%) rename src/battle/common/stage/{ => area_kmr}/kmr_06.inc.c (73%) create mode 100644 src/battle/common/stage/area_kpa/kpa_01.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_01b.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_02.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_03.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_04.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_04b.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_04c.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_05.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_07.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_08.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_09.inc.c create mode 100644 src/battle/common/stage/area_kpa/kpa_11.inc.c rename src/battle/{area/kmr_part_3/stage/kpa_01.c => common/stage/area_kpa/kpa_13.inc.c} (89%) create mode 100644 src/battle/common/stage/area_kpa/kpa_14.inc.c create mode 100644 src/battle/common/stage/area_kzn/Decorations.inc.c create mode 100644 src/battle/common/stage/area_kzn/kzn_01.inc.c create mode 100644 src/battle/common/stage/area_kzn/kzn_01b.inc.c create mode 100644 src/battle/common/stage/area_kzn/kzn_02.inc.c create mode 100644 src/battle/common/stage/area_kzn/kzn_04.inc.c create mode 100644 src/battle/common/stage/area_kzn/kzn_04b.inc.c create mode 100644 src/battle/common/stage/area_kzn/kzn_04c.inc.c create mode 100644 src/battle/common/stage/area_kzn/kzn_05.inc.c create mode 100644 src/battle/common/stage/area_mac/mac_01.inc.c create mode 100644 src/battle/common/stage/area_mac/mac_02.inc.c create mode 100644 src/battle/common/stage/area_mim/mim_01.inc.c rename src/battle/common/stage/{ => area_nok}/nok_01.inc.c (98%) create mode 100644 src/battle/common/stage/area_nok/nok_02.inc.c create mode 100644 src/battle/common/stage/area_nok/nok_03.inc.c create mode 100644 src/battle/common/stage/area_nok/nok_04.inc.c create mode 100644 src/battle/common/stage/area_omo/omo_01.inc.c create mode 100644 src/battle/common/stage/area_omo/omo_02.inc.c create mode 100644 src/battle/common/stage/area_omo/omo_03.inc.c create mode 100644 src/battle/common/stage/area_omo/omo_03b.inc.c create mode 100644 src/battle/common/stage/area_omo/omo_04.inc.c create mode 100644 src/battle/common/stage/area_omo/omo_05.inc.c create mode 100644 src/battle/common/stage/area_omo/omo_05b.inc.c create mode 100644 src/battle/common/stage/area_omo/omo_06.inc.c create mode 100644 src/battle/common/stage/area_omo/omo_07.inc.c create mode 100644 src/battle/common/stage/area_pra/pra_01.inc.c create mode 100644 src/battle/common/stage/area_pra/pra_02.inc.c create mode 100644 src/battle/common/stage/area_pra/pra_03.inc.c create mode 100644 src/battle/common/stage/area_pra/pra_03b.inc.c create mode 100644 src/battle/common/stage/area_pra/pra_03c.inc.c create mode 100644 src/battle/common/stage/area_pra/pra_04.inc.c create mode 100644 src/battle/common/stage/area_sam/sam_01.inc.c create mode 100644 src/battle/common/stage/area_sam/sam_02.inc.c create mode 100644 src/battle/common/stage/area_sam/sam_02b.inc.c create mode 100644 src/battle/common/stage/area_sam/sam_02c.inc.c create mode 100644 src/battle/common/stage/area_sam/sam_02d.inc.c create mode 100644 src/battle/common/stage/area_sam/sam_03.inc.c create mode 100644 src/battle/common/stage/area_sam/sam_04.inc.c create mode 100644 src/battle/common/stage/area_sbk/sbk_02.inc.c create mode 100644 src/battle/common/stage/area_tik/tik_01.inc.c create mode 100644 src/battle/common/stage/area_tik/tik_02.inc.c create mode 100644 src/battle/common/stage/area_tik/tik_03.inc.c create mode 100644 src/battle/common/stage/area_tik/tik_04.inc.c create mode 100644 src/battle/common/stage/area_tik/tik_05.inc.c rename src/battle/common/stage/{ => area_trd}/trd_00.inc.c (96%) rename src/battle/common/stage/{ => area_trd}/trd_01.inc.c (96%) rename src/battle/common/stage/{ => area_trd}/trd_02.inc.c (98%) rename src/battle/common/stage/{ => area_trd}/trd_02b.inc.c (98%) rename src/battle/common/stage/{ => area_trd}/trd_02c.inc.c (97%) rename src/battle/common/stage/{ => area_trd}/trd_02d.inc.c (97%) rename src/battle/common/stage/{ => area_trd}/trd_03.inc.c (97%) rename src/battle/common/stage/{ => area_trd}/trd_04.inc.c (97%) rename src/battle/common/stage/{ => area_trd}/trd_05.inc.c (98%) rename src/battle/common/stage/{ => area_trd}/trd_05b.inc.c (98%) rename src/battle/common/stage/{ => area_trd}/trd_05c.inc.c (98%) rename src/battle/common/stage/{ => area_trd}/trd_05d.inc.c (98%) rename src/battle/common/stage/{ => area_trd}/trd_05e.inc.c (97%) rename src/battle/common/stage/{ => area_trd}/trd_05f.inc.c (97%) create mode 100644 src/battle/common/stage/lib/DripVolumes.inc.c delete mode 100644 src/common/GetModelPos.inc.c delete mode 100644 src/common/UnkFogFunc.inc.c delete mode 100644 src/common/UnkFogFunc2.inc.c delete mode 100644 src/common/UpdateSunPos.inc.c delete mode 100644 src/world/common/todo/CheckDripCollisionWithNPC.inc.c delete mode 100644 src/world/common/todo/UnkFunc56.inc.c diff --git a/include/enums.h b/include/enums.h index 2fa72cfe77..946c47664c 100644 --- a/include/enums.h +++ b/include/enums.h @@ -3573,14 +3573,23 @@ enum StatusFlags { STATUS_FLAG_80000000 = 0x80000000, }; +// general combination of flags for checking if an enemy is immobilized #define STATUS_FLAGS_IMMOBILIZED \ - (STATUS_FLAG_STONE \ - | STATUS_FLAG_STOP \ - | STATUS_FLAG_DIZZY \ - | STATUS_FLAG_PARALYZE \ - | STATUS_FLAG_FEAR \ + (STATUS_FLAG_SLEEP \ | STATUS_FLAG_FROZEN \ - | STATUS_FLAG_SLEEP) + | STATUS_FLAG_FEAR \ + | STATUS_FLAG_PARALYZE \ + | STATUS_FLAG_DIZZY \ + | STATUS_FLAG_STONE \ + | STATUS_FLAG_STOP) + +// common set of flags used in checks throughout Dojo fights +#define STATUS_FLAGS_DOJO \ + (STATUS_FLAG_SLEEP \ + | STATUS_FLAG_PARALYZE \ + | STATUS_FLAG_DIZZY \ + | STATUS_FLAG_STONE \ + | STATUS_FLAG_STOP) enum DamageTypes { DAMAGE_TYPE_FIRE = 0x00000002, @@ -3610,7 +3619,7 @@ enum DamageTypes { DAMAGE_TYPE_SPIN_SMASH = 0x04000000, DAMAGE_TYPE_IGNORE_DEFENSE = 0x08000000, DAMAGE_TYPE_NO_CONTACT = 0x10000000, - DAMAGE_TYPE_MULTIPLE_POPUPS = 0x20000000, + DAMAGE_TYPE_MULTIPLE_POPUPS = 0x20000000, // part of an attack that hits multiple opponents DAMAGE_TYPE_STATUS_ALWAYS_HITS = 0x40000000, DAMAGE_TYPE_TRIGGER_LUCKY = 0x80000000, }; diff --git a/include/script_api/battle.h b/include/script_api/battle.h index 8ac6530983..f77256ec64 100644 --- a/include/script_api/battle.h +++ b/include/script_api/battle.h @@ -249,7 +249,7 @@ ApiStatus SetProjectileTargetOffset(Evt* script, s32 isInitialCall); ApiStatus EnableActorBlur(Evt* script, s32 isInitialCall); ApiStatus AfflictActor(Evt* script, s32 isInitialCall); ApiStatus GetInstigatorValue(Evt* script, s32 isInitialCall); -ApiStatus GetEncounterState(Evt* script, s32 isInitialCall); +ApiStatus GetEncounterTrigger(Evt* script, s32 isInitialCall); ApiStatus YieldTurn(Evt* script, s32 isInitialCall); ApiStatus SetActorSize(Evt* script, s32 isInitialCall); ApiStatus GetActorSize(Evt* script, s32 isInitialCall); diff --git a/src/16F740.c b/src/16F740.c index ba24fa975e..92f26e8621 100644 --- a/src/16F740.c +++ b/src/16F740.c @@ -3045,9 +3045,9 @@ void btl_state_update_end_player_turn(void) { partner->currentPos.x += (player->state.currentPos.x - partner->currentPos.x) / player->state.moveTime; partner->currentPos.z += (player->state.currentPos.z - partner->currentPos.z) / player->state.moveTime; } - player->currentPos.z += sin_rad((player->state.angle * TAU) / 360.0f) * 16.0f; + player->currentPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; player->yaw = clamp_angle(-player->state.angle); - partner->currentPos.z -= sin_rad((player->state.angle * TAU) / 360.0f) * 16.0f; + partner->currentPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; partner->yaw = clamp_angle(-player->state.angle); player->state.angle += 90.0f; diff --git a/src/17D6A0.c b/src/17D6A0.c index c95b4bb0ea..40f2018199 100644 --- a/src/17D6A0.c +++ b/src/17D6A0.c @@ -245,8 +245,8 @@ s32 bActorNames[ACTOR_TYPE_COUNT] = { [ACTOR_TYPE_SIGNAL_GUY] MSG_EnemyName_ShyGuy, [ACTOR_TYPE_SHY_SQUAD_DUP] MSG_EnemyName_ShySquadDup, [ACTOR_TYPE_SHY_GUY_DUP] MSG_EnemyName_ShyGuy, - [ACTOR_TYPE_ANTI_GUY] MSG_EnemyName_AntiGuy, - [ACTOR_TYPE_ANTI_GUY_DUP] MSG_EnemyName_AntiGuy, + [ACTOR_TYPE_ANTI_GUY_OMO] MSG_EnemyName_AntiGuy, + [ACTOR_TYPE_ANTI_GUY_KPA] MSG_EnemyName_AntiGuy, [ACTOR_TYPE_BIG_LANTERN_GHOST] MSG_EnemyName_BigLanternGhost, [ACTOR_TYPE_GOOMBA_KING_DUP] MSG_EnemyName_GoombaKing, [ACTOR_TYPE_LAVA_PIRANHA_PHASE_1] MSG_EnemyName_LavaPiranha, @@ -1519,14 +1519,14 @@ ActorSounds bActorSoundTable[ACTOR_TYPE_COUNT] = { .hurt = SOUND_10F, .delay = { 30, 30 } }, - [ACTOR_TYPE_ANTI_GUY] = { + [ACTOR_TYPE_ANTI_GUY_OMO] = { .walk = { SOUND_20BA, SOUND_3B4 }, .fly = { NULL, NULL }, .jump = SOUND_JUMP_3E2, .hurt = SOUND_10F, .delay = { 30, 30 } }, - [ACTOR_TYPE_ANTI_GUY_DUP] = { + [ACTOR_TYPE_ANTI_GUY_KPA] = { .walk = { SOUND_20BA, SOUND_3B4 }, .fly = { NULL, NULL }, .jump = SOUND_JUMP_3E2, @@ -1956,8 +1956,8 @@ s32 bActorTattles[ACTOR_TYPE_COUNT] = { [ACTOR_TYPE_SIGNAL_GUY] = MSG_EnemyTattle_ShyGuy, [ACTOR_TYPE_SHY_SQUAD_DUP] = NULL, [ACTOR_TYPE_SHY_GUY_DUP] = MSG_EnemyTattle_ShyGuy, - [ACTOR_TYPE_ANTI_GUY] = MSG_EnemyTattle_AntiGuy, - [ACTOR_TYPE_ANTI_GUY_DUP] = MSG_EnemyTattle_AntiGuy, + [ACTOR_TYPE_ANTI_GUY_OMO] = MSG_EnemyTattle_AntiGuy, + [ACTOR_TYPE_ANTI_GUY_KPA] = MSG_EnemyTattle_AntiGuy, [ACTOR_TYPE_BIG_LANTERN_GHOST] = MSG_EnemyTattle_BigLanternGhost, [ACTOR_TYPE_GOOMBA_KING_DUP] = MSG_EnemyTattle_GoombaKing, [ACTOR_TYPE_LAVA_PIRANHA_PHASE_1] = MSG_EnemyTattle_LavaPiranhaPhase1, @@ -2171,8 +2171,8 @@ ActorOffsets bActorOffsets[ACTOR_TYPE_COUNT] = { [ACTOR_TYPE_SIGNAL_GUY] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 }, [ACTOR_TYPE_SHY_SQUAD_DUP] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 }, [ACTOR_TYPE_SHY_GUY_DUP] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 }, - [ACTOR_TYPE_ANTI_GUY] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 }, - [ACTOR_TYPE_ANTI_GUY_DUP] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 }, + [ACTOR_TYPE_ANTI_GUY_OMO] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 }, + [ACTOR_TYPE_ANTI_GUY_KPA] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 }, [ACTOR_TYPE_BIG_LANTERN_GHOST] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 }, [ACTOR_TYPE_GOOMBA_KING_DUP] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 }, [ACTOR_TYPE_LAVA_PIRANHA_PHASE_1] = { .tattleCam = { 25, 250, 60 }, .shadow = 0 }, diff --git a/src/17FEB0.c b/src/17FEB0.c index a19e3fc708..426a47cdd6 100644 --- a/src/17FEB0.c +++ b/src/17FEB0.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" diff --git a/src/181810.c b/src/181810.c index 8ebe1f018a..974183067f 100644 --- a/src/181810.c +++ b/src/181810.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" BSS char D_8029F660[0x400]; // unused? diff --git a/src/1A5830.c b/src/1A5830.c index ec7140a3af..bd34f1f547 100644 --- a/src/1A5830.c +++ b/src/1A5830.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" @@ -3200,7 +3199,7 @@ ApiStatus GetInstigatorValue(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus GetEncounterState(Evt* script, s32 isInitialCall) { +ApiStatus GetEncounterTrigger(Evt* script, s32 isInitialCall) { evt_set_variable(script, *script->ptrReadPos, gCurrentEncounter.hitType); return ApiStatus_DONE2; } diff --git a/src/1AC760.c b/src/1AC760.c index c21661e1b5..02c4edd288 100644 --- a/src/1AC760.c +++ b/src/1AC760.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" diff --git a/src/415D90.c b/src/415D90.c index c26d3e5e08..b9b25e139e 100644 --- a/src/415D90.c +++ b/src/415D90.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "hud_element.h" #include "battle/action_cmd.h" @@ -4727,9 +4726,9 @@ void btl_state_update_twink_menu(void) { partner->currentPos.x += (player->state.currentPos.x - partner->currentPos.x) / player->state.moveTime; partner->currentPos.z += (player->state.currentPos.z - partner->currentPos.z) / player->state.moveTime; } - player->currentPos.z += sin_rad((player->state.angle * TAU) / 360.0f) * 16.0f; + player->currentPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; player->yaw = clamp_angle(-player->state.angle); - partner->currentPos.z -= sin_rad((player->state.angle * TAU) / 360.0f) * 16.0f; + partner->currentPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; partner->yaw = clamp_angle(-player->state.angle); player->state.angle += 90.0f; if (player->state.moveTime != 0) { diff --git a/src/actor_api.c b/src/actor_api.c index 59875c2f7c..f97ef4caff 100644 --- a/src/actor_api.c +++ b/src/actor_api.c @@ -2044,7 +2044,7 @@ ApiStatus SummonEnemy(Evt* script, s32 isInitialCall) { s32 i, j; u16 enemyID1, enemyID2; s32 priority1, priority2; - s32 tempPriority; + s32 basePriority; if (isInitialCall) { script->functionTemp[0] = 0; @@ -2053,7 +2053,7 @@ ApiStatus SummonEnemy(Evt* script, s32 isInitialCall) { switch (script->functionTemp[0]) { case 0: script->functionTempPtr[1] = create_actor((FormationRow*)evt_get_variable(script, *args++)); - script->functionTemp[2] = evt_get_variable(script, *args++); + script->functionTemp[2] = evt_get_variable(script, *args++); // isLowPriority script->functionTemp[0] = 1; break; case 1: @@ -2071,25 +2071,25 @@ ApiStatus SummonEnemy(Evt* script, s32 isInitialCall) { } } battleStatus->numEnemyActors = numEnemies; - if (script->functionTemp[2] != 0) { - tempPriority = -1000; + if (script->functionTemp[2]) { + basePriority = -1000; } else { - tempPriority = 1000; + basePriority = 1000; } enemyIDs = battleStatus->enemyIDs; for (i = 0; i < numEnemies - 1; i++) { for (j = i + 1; j < numEnemies; j++) { enemyID1 = enemyIDs[i]; - actor1 = battleStatus->enemyActors[(u8) enemyID1]; + actor1 = battleStatus->enemyActors[enemyID1 & 0xFF]; priority1 = actor1->turnPriority; if (actor1 == actor2) { - priority1 += tempPriority; + priority1 += basePriority; } enemyID2 = enemyIDs[j]; - actor1 = battleStatus->enemyActors[(u8) enemyID2]; + actor1 = battleStatus->enemyActors[enemyID2 & 0xFF]; priority2 = actor1->turnPriority; if (actor1 == actor2) { - priority2 += tempPriority; + priority2 += basePriority; } if (priority1 < priority2) { enemyIDs[i] = enemyID2; @@ -2100,7 +2100,7 @@ ApiStatus SummonEnemy(Evt* script, s32 isInitialCall) { } else { numEnemies = battleStatus->numEnemyActors; for (i = 0; i < numEnemies; i++){ - if (battleStatus->enemyActors[(u8) enemyIDs[i]] == actor2) { + if (battleStatus->enemyActors[enemyIDs[i] & 0xFF] == actor2) { enemyIDs[i] = -1; } } @@ -2133,21 +2133,21 @@ ApiStatus SetOwnerID(Evt* script, s32 isInitialCall) { } ApiStatus ActorExists(Evt* script, s32 isInitialCall) { - Bytecode isExist; Actor* partner = gBattleStatus.partnerActor; Bytecode* args = script->ptrReadPos; s32 actorID = evt_get_variable(script, *args++); + b32 exists; if (actorID == ACTOR_SELF) { actorID = script->owner1.actorID; } - isExist = get_actor(actorID) != NULL; + exists = get_actor(actorID) != NULL; if ((actorID == ACTOR_PARTNER) && (partner == NULL)) { - isExist = FALSE; + exists = FALSE; } - evt_set_variable(script, *args++, isExist); + evt_set_variable(script, *args++, exists); return ApiStatus_DONE2; } diff --git a/src/battle/action_cmd/air_raid.c b/src/battle/action_cmd/air_raid.c index 0c3f132121..fff5c36f40 100644 --- a/src/battle/action_cmd/air_raid.c +++ b/src/battle/action_cmd/air_raid.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "battle/action_cmd.h" diff --git a/src/battle/action_cmd/fire_shell.c b/src/battle/action_cmd/fire_shell.c index 45489359ac..768ded9a5e 100644 --- a/src/battle/action_cmd/fire_shell.c +++ b/src/battle/action_cmd/fire_shell.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "battle/action_cmd.h" diff --git a/src/battle/action_cmd/smack.c b/src/battle/action_cmd/smack.c index 38caf794da..123658b4f3 100644 --- a/src/battle/action_cmd/smack.c +++ b/src/battle/action_cmd/smack.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "battle/action_cmd.h" diff --git a/src/battle/area/arn/actor/hyper_cleft.c b/src/battle/area/arn/actor/hyper_cleft.c index 62a048e121..814cfc2687 100644 --- a/src/battle/area/arn/actor/hyper_cleft.c +++ b/src/battle/area/arn/actor/hyper_cleft.c @@ -1,844 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Cleft.h" +#include "../area.h" -#define NAMESPACE b_area_arn_hyper_cleft - -extern s32 N(IdleAnimations_80221CD4)[]; -extern EvtScript N(EVS_Init); -extern EvtScript N(idle_80221DD0); -extern EvtScript N(handleEvent_80222140); -extern EvtScript N(takeTurn_80221A58); -extern EvtScript N(takeTurn_80223B5C); -extern EvtScript N(nextTurn_80220D3C); -extern EvtScript N(80222F1C); -extern EvtScript N(80223310); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable_80220B40)[] = { - ELEMENT_NORMAL, 3, - ELEMENT_FIRE, 99, - ELEMENT_END, -}; - -s32 N(DefenseTable_80220B54)[] = { - ELEMENT_NORMAL, 1, - ELEMENT_FIRE, 99, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 40, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 50, - STATUS_KEY_SHRINK, 90, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 22 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80221CD4), - .defenseTable = N(DefenseTable_80220B40), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_HYPER_CLEFT, - .level = 15, - .maxHP = 4, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(EVS_Init), - .statusTable = N(StatusTable), - .escapeChance = 70, - .airLiftChance = 30, - .hurricaneChance = 30, - .spookChance = 30, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 95, - .coinReward = 2, - .size = { 44, 36 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_80220C60)[] = { - STATUS_KEY_NORMAL, ANIM_Cleft_Hyper_Anim04, - STATUS_KEY_STONE, ANIM_Cleft_Hyper_Anim00, - STATUS_KEY_SLEEP, ANIM_Cleft_Hyper_Anim0C, - STATUS_KEY_POISON, ANIM_Cleft_Hyper_Anim04, - STATUS_KEY_STOP, ANIM_Cleft_Hyper_Anim00, - STATUS_KEY_STATIC, ANIM_Cleft_Hyper_Anim04, - STATUS_KEY_PARALYZE, ANIM_Cleft_Hyper_Anim00, - STATUS_KEY_DIZZY, ANIM_Cleft_Hyper_Anim0E, - STATUS_KEY_FEAR, ANIM_Cleft_Hyper_Anim0E, - STATUS_END, -}; - -EvtScript N(EVS_Init) = { - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80221DD0))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80222140))) - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80221A58))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_80220D3C))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(nextTurn_80220D3C) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(PHASE_PLAYER_BEGIN) - EVT_CASE_EQ(PHASE_ENEMY_BEGIN) - EVT_CASE_EQ(PHASE_ENEMY_END) - EVT_CALL(SetBattleVar, 1, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 1) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -#include "common/StartRumbleWithParams.inc.c" - -EvtScript N(80220DC0) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_WAIT(20) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_POWER_UP) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 10) - EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 6, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 45, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim04) - EVT_WAIT(30) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 200, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.5)) - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D9) - EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 4, LVar0, LVar1, LVar2, 0, 0) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) - EVT_END_THREAD - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 2) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220C60))) - EVT_CALL(EnableActorGlow, ACTOR_SELF, TRUE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, TRUE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 30) - EVT_LOOP(20) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 1, 0, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, -1, 0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2DA) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_THREAD - EVT_LOOP(0) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_IF_GT(LVar0, LVar3) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_END_THREAD - EVT_THREAD - EVT_LOOP(30) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_PLAY_EFFECT(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2, 0, 0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, -200, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_WAIT(15) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(YieldTurn) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetActorPos, ACTOR_SELF, 300, 0, 0) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_LOOP(25) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_PLAY_EFFECT(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2, 0, 0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 8, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, 0) - EVT_LOOP(60) - EVT_ADD(LVar0, 18) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 50) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 30, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_WAIT(20) - EVT_CALL(YieldTurn) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_80221A58) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetBattleVar, 1, 1) - EVT_EXEC_WAIT(N(80223310)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_EXEC_WAIT(N(80222F1C)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 2) - EVT_EXEC_WAIT(N(80220DC0)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetBattleVar, 1, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 750) - EVT_CALL(SetBattleVar, 1, 2) - EVT_EXEC_WAIT(N(80220DC0)) - EVT_ELSE - EVT_CALL(SetBattleVar, 1, 1) - EVT_EXEC_WAIT(N(80223310)) - EVT_END_IF - EVT_ELSE - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 500) - EVT_CALL(SetBattleVar, 1, 2) - EVT_EXEC_WAIT(N(80220DC0)) - EVT_ELSE - EVT_CALL(SetBattleVar, 1, 1) - EVT_EXEC_WAIT(N(80223310)) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(80223310)) - EVT_RETURN - EVT_CASE_EQ(2) - EVT_EXEC_WAIT(N(80220DC0)) - EVT_RETURN - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -s32 N(IdleAnimations_80221CD4)[] = { - STATUS_KEY_NORMAL, ANIM_Cleft_Hyper_Anim02, - STATUS_KEY_STONE, ANIM_Cleft_Hyper_Anim00, - STATUS_KEY_SLEEP, ANIM_Cleft_Hyper_Anim0C, - STATUS_KEY_POISON, ANIM_Cleft_Hyper_Anim02, - STATUS_KEY_STOP, ANIM_Cleft_Hyper_Anim00, - STATUS_KEY_STATIC, ANIM_Cleft_Hyper_Anim02, - STATUS_KEY_PARALYZE, ANIM_Cleft_Hyper_Anim00, - STATUS_KEY_DIZZY, ANIM_Cleft_Hyper_Anim0E, - STATUS_KEY_FEAR, ANIM_Cleft_Hyper_Anim0E, - STATUS_END, -}; - -s32 N(IdleAnimations_80221D20)[] = { - STATUS_KEY_NORMAL, ANIM_Cleft_Hyper_Anim05, - STATUS_KEY_STONE, ANIM_Cleft_Hyper_Anim01, - STATUS_KEY_SLEEP, ANIM_Cleft_Hyper_Anim0D, - STATUS_KEY_POISON, ANIM_Cleft_Hyper_Anim05, - STATUS_KEY_STOP, ANIM_Cleft_Hyper_Anim01, - STATUS_KEY_STATIC, ANIM_Cleft_Hyper_Anim05, - STATUS_KEY_PARALYZE, ANIM_Cleft_Hyper_Anim01, - STATUS_KEY_DIZZY, ANIM_Cleft_Hyper_Anim0F, - STATUS_KEY_FEAR, ANIM_Cleft_Hyper_Anim0F, - STATUS_END, -}; - -EvtScript N(80221D6C) = { - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80221DD0))) - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80223B5C))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80222140))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_80221DD0) = { - EVT_RETURN - EVT_END -}; - -#include "common/SetSpinSmashable.inc.c" - -EvtScript N(80221DE0) = { - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_THREAD - EVT_SET(LVar0, 0) - EVT_LOOP(5) - EVT_ADD(LVar0, -36) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) - EVT_SUB(LVar1, 6) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 200, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) - EVT_END_THREAD - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 40, 8, EVT_FLOAT(0.0), 20, 0) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim03) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221D20))) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_80220B54))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -7) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) - EVT_CALL(N(SetSpinSmashable), 0) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80222140) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_CALL(GetLastElement, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_FLAG(DAMAGE_TYPE_BLAST) - EVT_EXEC_WAIT(N(80221DE0)) - EVT_CASE_DEFAULT - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_SWITCH - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_CALL(GetLastElement, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_FLAG(DAMAGE_TYPE_BLAST) - EVT_EXEC_WAIT(N(80221DE0)) - EVT_CASE_DEFAULT - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_END_IF - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE) - EVT_END_SWITCH - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 2) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim03) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim02) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_EQ(EVENT_SPIKE_TAUNT) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim18) - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, -3) - EVT_ADD(LVar1, 10) - EVT_ELSE - EVT_ADD(LVar0, -8) - EVT_ADD(LVar1, 27) - EVT_END_IF - EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) - EVT_WAIT(20) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim03) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim02) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_END_IF - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim07) - EVT_SET_CONST(LVar2, ANIM_Cleft_Hyper_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim0F) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim0F) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80222F1C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(3.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim03) - EVT_WAIT(20) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim05) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_IF_GT(LVar0, 0) - EVT_SUB(LVar0, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, LVar0) - EVT_ELSE - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim03) - EVT_THREAD - EVT_WAIT(3) - EVT_LOOP(5) - EVT_ADD(LVar0, 36) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar1, 6) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 200, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) - EVT_END_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_80220B40))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 22) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) - EVT_WAIT(1) - EVT_CALL(N(SetSpinSmashable), 1) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) - EVT_END_IF - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80223310) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 30) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(10) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(5) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim10) - EVT_WAIT(10) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, -5) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim00) - EVT_WAIT(8) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_THREAD - EVT_WAIT(10) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_THREAD - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 100) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 45) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim08) - EVT_WAIT(15) - EVT_WAIT(8) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 15) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.4)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_80223B5C) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_EXEC_WAIT(N(80222F1C)) - EVT_ELSE - EVT_EXEC_WAIT(N(80223310)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/hyper_cleft.inc.c" diff --git a/src/battle/area/arn/actor/hyper_goomba.c b/src/battle/area/arn/actor/hyper_goomba.c new file mode 100644 index 0000000000..4dcb584d4e --- /dev/null +++ b/src/battle/area/arn/actor/hyper_goomba.c @@ -0,0 +1,3 @@ +#include "../area.h" + +#include "battle/common/actor/hyper_goomba.inc.c" diff --git a/src/battle/area/arn/actor/hyper_paragoomba.c b/src/battle/area/arn/actor/hyper_paragoomba.c index d6cfa09054..2ef9da3be5 100644 --- a/src/battle/area/arn/actor/hyper_paragoomba.c +++ b/src/battle/area/arn/actor/hyper_paragoomba.c @@ -1,1498 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Goomba.h" -#include "sprite/npc/Paragoomba.h" +#include "../area.h" -#define NAMESPACE b_area_arn_hyper_paragoomba - -extern s32 N(IdleAnimations_8021C594)[]; -extern s32 N(IdleAnimations_8021C62C)[]; -extern s32 N(IdleAnimations_8021C638)[]; -extern s32 N(IdleAnimations_8021F05C)[]; -extern EvtScript N(init_8021B564); -extern EvtScript N(idle_8021C690); -extern EvtScript N(handleEvent_8021C9C4); -extern EvtScript N(nextTurn_8021B5F4); -extern EvtScript N(takeTurn_8021C36C); -extern EvtScript N(takeTurn_8021D1DC); -extern EvtScript N(8021C94C); -extern EvtScript N(8021D9F4); -extern EvtScript N(8021E058); -extern EvtScript N(idle_8021F140); -extern EvtScript N(handleEvent_8021F41C); -extern EvtScript N(takeTurn_8021EE34); -extern EvtScript N(takeTurn_8021FE6C); -extern EvtScript N(nextTurn_8021E194); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, -}; - -s32 N(DefenseTable_8021B2F0)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(DefenseTable_8021B2FC)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8021B308)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 80, - STATUS_KEY_POISON, 100, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 80, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 100, - STATUS_KEY_PARALYZE, 100, - STATUS_KEY_SHRINK, 80, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -s32 N(StatusTable_8021B3B4)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 80, - STATUS_KEY_POISON, 80, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 80, - STATUS_KEY_PARALYZE, 100, - STATUS_KEY_SHRINK, 80, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 22 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021F05C), - .defenseTable = N(DefenseTable_8021B2F0), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021C594), - .defenseTable = N(DefenseTable_8021B2FC), - .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -16, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021C62C), - .defenseTable = N(DefenseTable_8021B2F0), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_4, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -16, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021C638), - .defenseTable = N(DefenseTable_8021B2F0), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_FLYING, - .type = ACTOR_TYPE_HYPER_PARAGOOMBA, - .level = 12, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021B564), - .statusTable = N(StatusTable_8021B3B4), - .escapeChance = 50, - .airLiftChance = 95, - .hurricaneChance = 95, - .spookChance = 80, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 90, - .coinReward = 1, - .size = { 36, 26 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_8021B518)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_Miss, - STATUS_KEY_STONE, ANIM_Paragoomba_Hyper_Still, - STATUS_KEY_SLEEP, ANIM_Paragoomba_Hyper_Sleep, - STATUS_KEY_POISON, ANIM_Paragoomba_Hyper_Miss, - STATUS_KEY_STOP, ANIM_Paragoomba_Hyper_Still, - STATUS_KEY_STATIC, ANIM_Paragoomba_Hyper_Miss, - STATUS_KEY_PARALYZE, ANIM_Paragoomba_Hyper_Still, - STATUS_KEY_DIZZY, ANIM_Paragoomba_Hyper_Dizzy, - STATUS_KEY_FEAR, ANIM_Paragoomba_Hyper_Dizzy, - STATUS_END, -}; - -EvtScript N(init_8021B564) = { - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C690))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C9C4))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_8021B5F4))) - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021C36C))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(nextTurn_8021B5F4) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(PHASE_PLAYER_BEGIN) - EVT_CASE_EQ(PHASE_ENEMY_BEGIN) - EVT_CASE_EQ(PHASE_ENEMY_END) - EVT_CALL(SetBattleVar, 1, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(8021B678) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_WAIT(20) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_POWER_UP) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 10) - EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 6, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 45, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Miss) - EVT_WAIT(30) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, FALSE, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021B518))) - EVT_CALL(EnableActorGlow, ACTOR_SELF, TRUE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, TRUE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 30) - EVT_LOOP(20) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 1, 0, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, -1, 0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -60) - EVT_THREAD - EVT_SET(LVar0, -60) - EVT_LOOP(60) - EVT_ADD(LVar0, 19) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(15.0)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, FALSE, FALSE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, -60, 0, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(AddGoalPos, ACTOR_SELF, -200, 0, 0) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_WAIT(20) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_THREAD - EVT_SET(LVar0, 0) - EVT_LOOP(30) - EVT_ADD(LVar0, 24) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(SetActorPos, ACTOR_SELF, 300, 0, 0) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Idle) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -70) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(15.0)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, FALSE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 8, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, -70) - EVT_LOOP(60) - EVT_ADD(LVar0, 18) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_SUB(LVar0, 70) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, FALSE, FALSE) - EVT_SUB(LVar0, 60) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, FALSE, FALSE) - EVT_WAIT(20) - EVT_CALL(YieldTurn) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) - EVT_EXEC_WAIT(N(8021C94C)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021C36C) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetBattleVar, 1, 1) - EVT_EXEC_WAIT(N(takeTurn_8021D1DC)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_EXEC_WAIT(N(8021B678)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetBattleVar, 1, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 750) - EVT_CALL(SetBattleVar, 1, 2) - EVT_EXEC_WAIT(N(8021B678)) - EVT_ELSE - EVT_CALL(SetBattleVar, 1, 1) - EVT_EXEC_WAIT(N(takeTurn_8021D1DC)) - EVT_END_IF - EVT_ELSE - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 500) - EVT_CALL(SetBattleVar, 1, 2) - EVT_EXEC_WAIT(N(8021B678)) - EVT_ELSE - EVT_CALL(SetBattleVar, 1, 1) - EVT_EXEC_WAIT(N(takeTurn_8021D1DC)) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(takeTurn_8021D1DC)) - EVT_CASE_EQ(2) - EVT_EXEC_WAIT(N(8021B678)) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -s32 N(IdleAnimations_8021C594)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_Idle, - STATUS_KEY_STONE, ANIM_Paragoomba_Hyper_Still, - STATUS_KEY_SLEEP, ANIM_Paragoomba_Hyper_Sleep, - STATUS_KEY_POISON, ANIM_Paragoomba_Hyper_Idle, - STATUS_KEY_STOP, ANIM_Paragoomba_Hyper_Still, - STATUS_KEY_STATIC, ANIM_Paragoomba_Hyper_Idle, - STATUS_KEY_PARALYZE, ANIM_Paragoomba_Hyper_Still, - STATUS_KEY_DIZZY, ANIM_Paragoomba_Hyper_Dizzy, - STATUS_KEY_FEAR, ANIM_Paragoomba_Hyper_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_8021C5E0)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_Run, - STATUS_KEY_STONE, ANIM_Paragoomba_Hyper_Still, - STATUS_KEY_SLEEP, ANIM_Paragoomba_Hyper_Sleep, - STATUS_KEY_POISON, ANIM_Paragoomba_Hyper_Idle, - STATUS_KEY_STOP, ANIM_Paragoomba_Hyper_Still, - STATUS_KEY_STATIC, ANIM_Paragoomba_Hyper_Run, - STATUS_KEY_PARALYZE, ANIM_Paragoomba_Hyper_Still, - STATUS_KEY_DIZZY, ANIM_Paragoomba_Hyper_Dizzy, - STATUS_KEY_FEAR, ANIM_Paragoomba_Hyper_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_8021C62C)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_LWingStill, - STATUS_END, -}; - -s32 N(IdleAnimations_8021C638)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_RWingStill, - STATUS_END, -}; - -EvtScript N(8021C644) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021D1DC))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C690))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C9C4))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_8021C690) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C5E0))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) - EVT_LOOP(40) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021C94C) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Idle) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021C9C4) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(GetEncounterState, LVar0) - EVT_IF_EQ(LVar0, 4) - EVT_EXEC_WAIT(N(8021D9F4)) - EVT_END_IF - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hyper_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hyper_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_FALL_TRIGGER) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_EXEC_WAIT(N(8021D9F4)) - EVT_CASE_EQ(EVENT_15) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hyper_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(8021D9F4)) - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dizzy) - EVT_EXEC_WAIT(N(8021C94C)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) - EVT_END_IF - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) - EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) - EVT_CALL(HPBarToCurrent, ACTOR_SELF) - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) - EVT_EXEC_WAIT(N(8021C94C)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Run) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021D1DC) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_LINEAR) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) - EVT_CALL(SetBattleCamZoom, 300) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dive) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_SUB(LVar0, 80) - EVT_SET(LVar1, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dive) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) - EVT_THREAD - EVT_LOOP(4) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DF) - EVT_WAIT(4) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Miss) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(3.0)) - EVT_WAIT(10) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(8021C94C)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) - EVT_CALL(SetBattleCamZoom, 300) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dive) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dive) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) - EVT_END_SWITCH - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) - EVT_EXEC_WAIT(N(8021C94C)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/StartRumbleWithParams.inc.c" - -EvtScript N(8021D9F4) = { - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_3, -9, 7, -2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_4, 11, 7, -2) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar0, EVENT_15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_BurnStill) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Hurt) - EVT_END_IF - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 100, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) - EVT_END_THREAD - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar3) - EVT_IF_EQ(LVar3, EVENT_15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Hurt) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_ADD(LVar4, 10) - EVT_ADD(LVar5, 5) - EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar3, LVar4, LVar5, EVT_FLOAT(1.0), 10, 0) - EVT_END_IF - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_LOOP(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) - EVT_MOD(LVar0, 4) - EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_8021B308))) - EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_HYPER_GOOMBA) - EVT_EXEC_WAIT(N(8021E058)) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_RETURN - EVT_END -}; - -s32 N(IdleAnimations_8021DF7C)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Hyper_Sleep, - STATUS_KEY_STONE, ANIM_Goomba_Hyper_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Hyper_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Hyper_Sleep, - STATUS_KEY_STOP, ANIM_Goomba_Hyper_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Hyper_Sleep, - STATUS_KEY_PARALYZE, ANIM_Goomba_Hyper_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Hyper_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Hyper_Dizzy, - STATUS_END, -}; - -EvtScript N(8021DFC8) = { - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021F140))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021F41C))) - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021EE34))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_8021E194))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021E058) = { - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021F140))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021F41C))) - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021EE34))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_8021E194))) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, TRUE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_END_SWITCH - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, LVar0) - EVT_RETURN - EVT_END -}; - -EvtScript N(nextTurn_8021E194) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(PHASE_PLAYER_BEGIN) - EVT_CASE_EQ(PHASE_ENEMY_BEGIN) - EVT_CASE_EQ(PHASE_ENEMY_END) - EVT_CALL(SetBattleVar, 1, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(8021E218) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_WAIT(20) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_POWER_UP) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 10) - EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 6, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 45, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) - EVT_WAIT(30) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, 0, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DD) - EVT_CALL(N(StartRumbleWithParams), 128, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.5)) - EVT_END_THREAD - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DF7C))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_CALL(EnableActorGlow, ACTOR_SELF, TRUE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, TRUE) - EVT_WAIT(2) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_LOOP(20) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 1, 0, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, -1, 0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_THREAD - EVT_LOOP(0) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_IF_GT(LVar0, LVar3) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_END_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 80) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_10F, 0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, -200, 0, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(15.0)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) - EVT_WAIT(20) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorPos, ACTOR_SELF, 300, 0, 0) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_10F, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 80) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(15.0)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 8, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) - EVT_SET(LVar0, 80) - EVT_LOOP(60) - EVT_ADD(LVar0, 18) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_SUB(LVar0, 50) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 30, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_WAIT(10) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021EE34) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetBattleVar, 1, 1) - EVT_EXEC_WAIT(N(takeTurn_8021FE6C)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_EXEC_WAIT(N(8021E218)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetBattleVar, 1, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 750) - EVT_CALL(SetBattleVar, 1, 2) - EVT_EXEC_WAIT(N(8021E218)) - EVT_ELSE - EVT_CALL(SetBattleVar, 1, 1) - EVT_EXEC_WAIT(N(takeTurn_8021FE6C)) - EVT_END_IF - EVT_ELSE - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 500) - EVT_CALL(SetBattleVar, 1, 2) - EVT_EXEC_WAIT(N(8021E218)) - EVT_ELSE - EVT_CALL(SetBattleVar, 1, 1) - EVT_EXEC_WAIT(N(takeTurn_8021FE6C)) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(takeTurn_8021FE6C)) - EVT_CASE_EQ(2) - EVT_EXEC_WAIT(N(8021E218)) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -s32 N(IdleAnimations_8021F05C)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Hyper_Idle, - STATUS_KEY_STONE, ANIM_Goomba_Hyper_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Hyper_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Hyper_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Hyper_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Hyper_Idle, - STATUS_KEY_PARALYZE, ANIM_Goomba_Hyper_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Hyper_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Hyper_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_8021F0A8)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Hyper_Run, - STATUS_KEY_STONE, ANIM_Goomba_Hyper_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Hyper_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Hyper_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Hyper_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Hyper_Run, - STATUS_KEY_PARALYZE, ANIM_Goomba_Hyper_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Hyper_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Hyper_Dizzy, - STATUS_END, -}; - -EvtScript N(8021F0F4) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021FE6C))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021F140))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021F41C))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_8021F140) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F0A8))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F0A8))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) - EVT_LOOP(80) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021F41C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_Hyper_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_Hyper_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Dizzy) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Run) - EVT_SET_CONST(LVar2, ANIM_Goomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/CalculateArcsinDeg.inc.c" - -EvtScript N(takeTurn_8021FE6C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 10) - EVT_ADD(LVar2, 3) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Sleep) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Hurt) - EVT_WAIT(5) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_THREAD - EVT_WAIT(4) - EVT_SET(LVar0, 180) - EVT_LOOP(4) - EVT_SUB(LVar0, 45) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Dizzy) - EVT_WAIT(5) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Tense) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_END_SWITCH - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) - EVT_WAIT(3) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/hyper_paragoomba.inc.c" diff --git a/src/battle/area/arn/actor/tubba_blubba.c b/src/battle/area/arn/actor/tubba_blubba.c index 598dd8f4a0..d9cb15444d 100644 --- a/src/battle/area/arn/actor/tubba_blubba.c +++ b/src/battle/area/arn/actor/tubba_blubba.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BattleTubba.h" -#define NAMESPACE b_area_arn_tubba_blubba +#define NAMESPACE A(tubba_blubba) extern EvtScript N(init_80225D98); extern EvtScript N(takeTurn_802264AC); @@ -181,65 +178,65 @@ EvtScript N(handleEvent_802260D0) = { EVT_SWITCH(LVarA) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(80227878)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(MoveBattleCamOver, 20) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(80225FD4)) EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(MoveBattleCamOver, 20) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_EXEC_WAIT(N(80227878)) EVT_RETURN EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(80227878)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(80227878)) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/arn/actor/tubbas_heart.c b/src/battle/area/arn/actor/tubbas_heart.c index 0d9c5560d8..73f049b06b 100644 --- a/src/battle/area/arn/actor/tubbas_heart.c +++ b/src/battle/area/arn/actor/tubbas_heart.c @@ -1,11 +1,8 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BattleBow.h" #include "sprite/npc/TubbasHeart.h" -#define NAMESPACE b_area_arn_tubbas_heart +#define NAMESPACE A(tubbas_heart) extern EvtScript N(init_80223DA0); extern EvtScript N(takeTurn_802245C8); @@ -206,28 +203,28 @@ EvtScript N(handleEvent_80224038) = { EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) EVT_EXEC_WAIT(N(80223FD8)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) EVT_CASE_OR_EQ(EVENT_BURN_HIT) EVT_CASE_OR_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TubbasHeart_Anim10) EVT_SET_CONST(LVar2, ANIM_TubbasHeart_Anim11) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) EVT_EXEC_WAIT(N(80223FD8)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_OR_EQ(EVENT_SHOCK_HIT) EVT_CASE_OR_EQ(EVENT_SHOCK_DEATH) EVT_EXEC_WAIT(N(80223FD8)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_EXEC_WAIT(N(80223FD8)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_TubbasHeart_Anim03) EVT_EXEC_WAIT(N(802244DC)) @@ -240,17 +237,17 @@ EvtScript N(handleEvent_80224038) = { EVT_IF_NE(LVar0, 0) EVT_SET(LVar1, 7077899) EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_OR_EQ(EVENT_DEATH) EVT_EXEC_WAIT(N(80223FD8)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_EXEC_WAIT(N(80223FD8)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIKE_CONTACT) EVT_CASE_EQ(EVENT_BURN_CONTACT) @@ -259,7 +256,7 @@ EvtScript N(handleEvent_80224038) = { EVT_EXEC_WAIT(N(802244DC)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TubbasHeart_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/arn/area.c b/src/battle/area/arn/area.c index 351ca1eb48..cde129fa8a 100644 --- a/src/battle/area/arn/area.c +++ b/src/battle/area/arn/area.c @@ -1,145 +1,142 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_arn +extern ActorBlueprint A(hyper_cleft); +extern ActorBlueprint A(hyper_goomba); +extern ActorBlueprint A(hyper_paragoomba); +extern ActorBlueprint A(tubba_blubba); +extern ActorBlueprint A(tubbas_heart); -extern ActorBlueprint N(hyper_cleft); -extern ActorBlueprint N(hypergoomba); -extern ActorBlueprint N(hyper_paragoomba); -extern ActorBlueprint N(tubba_blubba); -extern ActorBlueprint N(tubbas_heart); +extern Stage A(arn_01); +extern Stage A(arn_02); +extern Stage A(arn_03); +extern Stage A(arn_04); +extern Stage A(arn_05); +extern Stage A(arn_06); -extern Stage N(arn_01); -extern Stage N(arn_02); -extern Stage N(arn_03); -extern Stage N(arn_04); -extern Stage N(arn_05); -extern Stage N(arn_06); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_B, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_C, 8), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_C, 8), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_C, 8), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_D, 7), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_D, 7), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_D, 7), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_B, 10), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_B, 10), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_C, 9), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_C, 9), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_C, 8), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_C, 8), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(hyper_paragoomba), BTL_POS_AIR_D, 7), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(hyper_paragoomba), BTL_POS_AIR_D, 7), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(hyper_cleft), BTL_POS_GROUND_B, 10), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(hyper_cleft), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(hyper_cleft), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(hyper_cleft), BTL_POS_GROUND_C, 9), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(hyper_cleft), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(hyper_cleft), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(hyper_cleft), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hyper_cleft), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hyper_cleft), BTL_POS_GROUND_C, 8), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(hyper_cleft), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hyper_cleft), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hyper_cleft), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(hyper_cleft), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_C, 8), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(hyper_cleft), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(hyper_cleft), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hyper_cleft), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(hypergoomba), BTL_POS_GROUND_D, 7), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(hyper_cleft), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hyper_cleft), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(hyper_goomba), BTL_POS_GROUND_D, 7), }; -Vec3i N(vector3D_802280C0) = { 90, 20, 0 }; +Vec3i A(vector3D_802280C0) = { 90, 20, 0 }; -Formation N(Formation_0F) = { - ACTOR_BY_POS(N(tubbas_heart), N(vector3D_802280C0), 10), +Formation A(Formation_0F) = { + ACTOR_BY_POS(A(tubbas_heart), A(vector3D_802280C0), 10), }; -Vec3i N(vector3D_802280E8) = { 75, 0, 10 }; +Vec3i A(vector3D_802280E8) = { 75, 0, 10 }; -Formation N(Formation_10) = { - ACTOR_BY_POS(N(tubba_blubba), N(vector3D_802280E8), 10), +Formation A(Formation_10) = { + ACTOR_BY_POS(A(tubba_blubba), A(vector3D_802280E8), 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(arn_01), "ハイパークリボー"), - BATTLE(N(Formation_01), N(arn_01), "ハイパークリボーx2"), - BATTLE(N(Formation_02), N(arn_01), "ハイパークリボーx3"), - BATTLE(N(Formation_03), N(arn_01), "ハイパークリボーx2,ハイパーパタクリボー"), - BATTLE(N(Formation_04), N(arn_01), "ハイパークリボーx3,ハイパーパタクリボー"), - BATTLE(N(Formation_05), N(arn_01), "ハイパークリボーx2,ハイパーパタクリボー,ハイパークリボー"), - BATTLE(N(Formation_06), N(arn_01), "ハイパーパタクリボー"), - BATTLE(N(Formation_07), N(arn_01), "ハイパーパタクリボーx2"), - BATTLE(N(Formation_08), N(arn_01), "ハイパーパタクリボーx3"), - BATTLE(N(Formation_09), N(arn_01), "ハイパーパタクリボーx4"), - BATTLE(N(Formation_0A), N(arn_01), "ハイパーシンエモン"), - BATTLE(N(Formation_0B), N(arn_01), "ハイパーシンエモンx2"), - BATTLE(N(Formation_0C), N(arn_01), "ハイパーシンエモンx3"), - BATTLE(N(Formation_0D), N(arn_01), "ハイパーシンエモン,ハイパークリボーx2"), - BATTLE(N(Formation_0E), N(arn_01), "ハイパーシンエモンx2,ハイパークリボーx2"), - BATTLE(N(Formation_0F), N(arn_06), "ドガボンしんぞう"), - BATTLE(N(Formation_10), N(arn_01), "ドガボン"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(arn_01), "ハイパークリボー"), + BATTLE(A(Formation_01), A(arn_01), "ハイパークリボーx2"), + BATTLE(A(Formation_02), A(arn_01), "ハイパークリボーx3"), + BATTLE(A(Formation_03), A(arn_01), "ハイパークリボーx2,ハイパーパタクリボー"), + BATTLE(A(Formation_04), A(arn_01), "ハイパークリボーx3,ハイパーパタクリボー"), + BATTLE(A(Formation_05), A(arn_01), "ハイパークリボーx2,ハイパーパタクリボー,ハイパークリボー"), + BATTLE(A(Formation_06), A(arn_01), "ハイパーパタクリボー"), + BATTLE(A(Formation_07), A(arn_01), "ハイパーパタクリボーx2"), + BATTLE(A(Formation_08), A(arn_01), "ハイパーパタクリボーx3"), + BATTLE(A(Formation_09), A(arn_01), "ハイパーパタクリボーx4"), + BATTLE(A(Formation_0A), A(arn_01), "ハイパーシンエモン"), + BATTLE(A(Formation_0B), A(arn_01), "ハイパーシンエモンx2"), + BATTLE(A(Formation_0C), A(arn_01), "ハイパーシンエモンx3"), + BATTLE(A(Formation_0D), A(arn_01), "ハイパーシンエモン,ハイパークリボーx2"), + BATTLE(A(Formation_0E), A(arn_01), "ハイパーシンエモンx2,ハイパークリボーx2"), + BATTLE(A(Formation_0F), A(arn_06), "ドガボンしんぞう"), + BATTLE(A(Formation_10), A(arn_01), "ドガボン"), {}, }; -StageList N(Stages) = { - STAGE("arn_01", N(arn_01)), - STAGE("arn_02", N(arn_02)), - STAGE("arn_03", N(arn_03)), - STAGE("arn_04", N(arn_04)), - STAGE("arn_05", N(arn_05)), - STAGE("arn_06", N(arn_06)), +StageList A(Stages) = { + STAGE("arn_01", A(arn_01)), + STAGE("arn_02", A(arn_02)), + STAGE("arn_03", A(arn_03)), + STAGE("arn_04", A(arn_04)), + STAGE("arn_05", A(arn_05)), + STAGE("arn_06", A(arn_06)), {}, }; diff --git a/src/battle/area/arn/area.h b/src/battle/area/arn/area.h new file mode 100644 index 0000000000..6a894db407 --- /dev/null +++ b/src/battle/area/arn/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_arn diff --git a/src/battle/area/arn/stage/arn_01.c b/src/battle/area/arn/stage/arn_01.c index 22b6d0872b..570e05ff2a 100644 --- a/src/battle/area/arn/stage/arn_01.c +++ b/src/battle/area/arn/stage/arn_01.c @@ -1,32 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/arn_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_arn_arn_01 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_iwa4, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "arn_tex", - .shape = "arn_bt01_shape", - .hit = "arn_bt01_hit", - .bg = "arn_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_arn/arn_01.inc.c" diff --git a/src/battle/area/arn/stage/arn_02.c b/src/battle/area/arn/stage/arn_02.c index ab0da44497..cfce1945e0 100644 --- a/src/battle/area/arn/stage/arn_02.c +++ b/src/battle/area/arn/stage/arn_02.c @@ -1,49 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/arn_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_arn_arn_02 - -EvtScript N(EVS_RotateWindmill) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar0, 0) - EVT_LABEL(0) - EVT_ADD(LVar0, 1) - EVT_IF_GT(LVar0, 359) - EVT_SUB(LVar0, 360) - EVT_END_IF - EVT_CALL(RotateModel, LVarA, LVar0, 0, 0, 1) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_SET(LVar0, MODEL_o332) - EVT_EXEC_WAIT(N(EVS_RotateWindmill)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_iwa4, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "arn_tex", - .shape = "arn_bt02_shape", - .hit = "arn_bt02_hit", - .bg = "arn_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_arn/arn_02.inc.c" diff --git a/src/battle/area/arn/stage/arn_03.c b/src/battle/area/arn/stage/arn_03.c index 5b6b7a2214..2fb390b593 100644 --- a/src/battle/area/arn/stage/arn_03.c +++ b/src/battle/area/arn/stage/arn_03.c @@ -1,32 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/arn_bt03_shape.h" +#include "../area.h" -#define NAMESPACE b_area_arn_arn_03 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_iwa4, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "arn_tex", - .shape = "arn_bt03_shape", - .hit = "arn_bt03_hit", - .bg = "arn_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_arn/arn_03.inc.c" diff --git a/src/battle/area/arn/stage/arn_04.c b/src/battle/area/arn/stage/arn_04.c index 5a2f5762b6..5168af6da4 100644 --- a/src/battle/area/arn/stage/arn_04.c +++ b/src/battle/area/arn/stage/arn_04.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/arn_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_arn_arn_04 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o349, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "arn_tex", - .shape = "arn_bt04_shape", - .hit = "arn_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_arn/arn_04.inc.c" diff --git a/src/battle/area/arn/stage/arn_05.c b/src/battle/area/arn/stage/arn_05.c index e9a7517cda..be326fdce9 100644 --- a/src/battle/area/arn/stage/arn_05.c +++ b/src/battle/area/arn/stage/arn_05.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/arn_bt05_shape.h" +#include "../area.h" -#define NAMESPACE b_area_arn_arn_05 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o354, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "arn_tex", - .shape = "arn_bt05_shape", - .hit = "arn_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_arn/arn_05.inc.c" diff --git a/src/battle/area/arn/stage/arn_06.c b/src/battle/area/arn/stage/arn_06.c index 4636b095c0..b7d57b9d73 100644 --- a/src/battle/area/arn/stage/arn_06.c +++ b/src/battle/area/arn/stage/arn_06.c @@ -1,30 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/arn_bt06_shape.h" +#include "../area.h" -#define NAMESPACE b_area_arn_arn_06 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_kabe3, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "arn_tex", - .shape = "arn_bt06_shape", - .hit = "arn_bt06_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_arn/arn_06.inc.c" diff --git a/src/battle/area/dgb/actor/clubba.c b/src/battle/area/dgb/actor/clubba.c index 38d3d65899..0db0c21053 100644 --- a/src/battle/area/dgb/actor/clubba.c +++ b/src/battle/area/dgb/actor/clubba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_dgb_clubba +#include "../area.h" #include "battle/common/actor/clubba.inc.c" diff --git a/src/battle/area/dgb/actor/tubba_blubba.c b/src/battle/area/dgb/actor/tubba_blubba.c index fedaad6617..2723392615 100644 --- a/src/battle/area/dgb/actor/tubba_blubba.c +++ b/src/battle/area/dgb/actor/tubba_blubba.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BattleTubba.h" -#define NAMESPACE b_area_dgb_tubba_blubba +#define NAMESPACE A(tubba_blubba) extern EvtScript N(EVS_Init); extern EvtScript N(takeTurn_80219750); @@ -222,7 +219,7 @@ EvtScript N(handleEvent_80219338) = { EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) EVT_EXEC_WAIT(N(802192E0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim02) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP @@ -234,7 +231,7 @@ EvtScript N(handleEvent_80219338) = { EVT_WAIT(15) EVT_IF_EQ(LVar0, EVENT_BURN_DEATH) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -242,14 +239,14 @@ EvtScript N(handleEvent_80219338) = { EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) EVT_EXEC_WAIT(N(802192E0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(80219238)) @@ -257,26 +254,26 @@ EvtScript N(handleEvent_80219338) = { EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) EVT_EXEC_WAIT(N(802192E0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_OR_EQ(EVENT_SHOCK_DEATH) EVT_CASE_OR_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -286,7 +283,7 @@ EvtScript N(handleEvent_80219338) = { EVT_EXEC_WAIT(N(80219238)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleTubba_Anim02) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/dgb/area.c b/src/battle/area/dgb/area.c index b184273253..7e348e4212 100644 --- a/src/battle/area/dgb/area.c +++ b/src/battle/area/dgb/area.c @@ -1,64 +1,61 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_dgb +extern ActorBlueprint A(clubba); +extern ActorBlueprint A(tubba_blubba); -extern ActorBlueprint N(clubba); -extern ActorBlueprint N(tubba_blubba); +extern Stage A(dgb_01); +extern Stage A(dgb_02); +extern Stage A(dgb_03); +extern Stage A(dgb_04); +extern Stage A(dgb_05); -extern Stage N(dgb_01); -extern Stage N(dgb_02); -extern Stage N(dgb_03); -extern Stage N(dgb_04); -extern Stage N(dgb_05); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_B, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_C, 8), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_D, 7), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_D, 7), }; -Vec3i N(vector3D_8021B348) = { 75, 0, 10 }; +Vec3i A(vector3D_8021B348) = { 75, 0, 10 }; -Formation N(Formation_04) = { - ACTOR_BY_POS(N(tubba_blubba), N(vector3D_8021B348), 10), +Formation A(Formation_04) = { + ACTOR_BY_POS(A(tubba_blubba), A(vector3D_8021B348), 10), }; -Formation N(Formation_05) = { - ACTOR_BY_POS(N(tubba_blubba), N(vector3D_8021B348), 10, 1), +Formation A(Formation_05) = { + ACTOR_BY_POS(A(tubba_blubba), A(vector3D_8021B348), 10, 1), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(dgb_01), "ガボンへい"), - BATTLE(N(Formation_01), N(dgb_01), "ガボンへいx2"), - BATTLE(N(Formation_02), N(dgb_01), "ガボンへいx3"), - BATTLE(N(Formation_03), N(dgb_01), "ガボンへいx4"), - BATTLE(N(Formation_04), N(dgb_01), "むてきドガボン"), - BATTLE(N(Formation_05), N(dgb_01), "むてきドガボンせりふなし"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(dgb_01), "ガボンへい"), + BATTLE(A(Formation_01), A(dgb_01), "ガボンへいx2"), + BATTLE(A(Formation_02), A(dgb_01), "ガボンへいx3"), + BATTLE(A(Formation_03), A(dgb_01), "ガボンへいx4"), + BATTLE(A(Formation_04), A(dgb_01), "むてきドガボン"), + BATTLE(A(Formation_05), A(dgb_01), "むてきドガボンせりふなし"), {}, }; -StageList N(Stages) = { - STAGE("dgb_01", N(dgb_01)), - STAGE("dgb_02", N(dgb_02)), - STAGE("dgb_03", N(dgb_03)), - STAGE("dgb_04", N(dgb_04)), - STAGE("dgb_05", N(dgb_05)), +StageList A(Stages) = { + STAGE("dgb_01", A(dgb_01)), + STAGE("dgb_02", A(dgb_02)), + STAGE("dgb_03", A(dgb_03)), + STAGE("dgb_04", A(dgb_04)), + STAGE("dgb_05", A(dgb_05)), {}, }; diff --git a/src/battle/area/dgb/area.h b/src/battle/area/dgb/area.h new file mode 100644 index 0000000000..9006917781 --- /dev/null +++ b/src/battle/area/dgb/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_dgb diff --git a/src/battle/area/dgb/stage/dgb_01.c b/src/battle/area/dgb/stage/dgb_01.c index 2a1a1c48af..108621ad82 100644 --- a/src/battle/area/dgb/stage/dgb_01.c +++ b/src/battle/area/dgb/stage/dgb_01.c @@ -1,24 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/dgb_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_dgb_dgb_01 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "dgb_tex", - .shape = "dgb_bt01_shape", - .hit = "dgb_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_dgb/dgb_01.inc.c" diff --git a/src/battle/area/dgb/stage/dgb_02.c b/src/battle/area/dgb/stage/dgb_02.c index 540376c02d..b22737de3d 100644 --- a/src/battle/area/dgb/stage/dgb_02.c +++ b/src/battle/area/dgb/stage/dgb_02.c @@ -1,24 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/dgb_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_dgb_dgb_02 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "dgb_tex", - .shape = "dgb_bt02_shape", - .hit = "dgb_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_dgb/dgb_02.inc.c" diff --git a/src/battle/area/dgb/stage/dgb_03.c b/src/battle/area/dgb/stage/dgb_03.c index d2bc1804a9..53d0d41ad3 100644 --- a/src/battle/area/dgb/stage/dgb_03.c +++ b/src/battle/area/dgb/stage/dgb_03.c @@ -1,24 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/dgb_bt03_shape.h" +#include "../area.h" -#define NAMESPACE b_area_dgb_dgb_03 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "dgb_tex", - .shape = "dgb_bt03_shape", - .hit = "dgb_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_dgb/dgb_03.inc.c" diff --git a/src/battle/area/dgb/stage/dgb_04.c b/src/battle/area/dgb/stage/dgb_04.c index 3cc2ff7b8f..f3d0814b22 100644 --- a/src/battle/area/dgb/stage/dgb_04.c +++ b/src/battle/area/dgb/stage/dgb_04.c @@ -1,30 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/dgb_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_dgb_dgb_04 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_kumo1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "dgb_tex", - .shape = "dgb_bt04_shape", - .hit = "dgb_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_dgb/dgb_04.inc.c" diff --git a/src/battle/area/dgb/stage/dgb_05.c b/src/battle/area/dgb/stage/dgb_05.c index 428e63d0d8..242d46611e 100644 --- a/src/battle/area/dgb/stage/dgb_05.c +++ b/src/battle/area/dgb/stage/dgb_05.c @@ -1,24 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/dgb_bt05_shape.h" +#include "../area.h" -#define NAMESPACE b_area_dgb_dgb_05 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "dgb_tex", - .shape = "dgb_bt05_shape", - .hit = "dgb_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_dgb/dgb_05.inc.c" diff --git a/src/battle/area/dig/actor/bandit.c b/src/battle/area/dig/actor/bandit.c index 357d5c296d..4d4a335670 100644 --- a/src/battle/area/dig/actor/bandit.c +++ b/src/battle/area/dig/actor/bandit.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_dig_bandit +#include "../area.h" #include "battle/common/actor/bandit.inc.c" diff --git a/src/battle/area/dig/actor/fuzzy.c b/src/battle/area/dig/actor/fuzzy.c index 8732f022b3..af27120fee 100644 --- a/src/battle/area/dig/actor/fuzzy.c +++ b/src/battle/area/dig/actor/fuzzy.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_dig_fuzzy +#include "../area.h" #include "battle/common/actor/fuzzy.inc.c" diff --git a/src/battle/area/dig/actor/koopa_troopa.c b/src/battle/area/dig/actor/koopa_troopa.c index 61596f34b0..2c15873fca 100644 --- a/src/battle/area/dig/actor/koopa_troopa.c +++ b/src/battle/area/dig/actor/koopa_troopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_dig_koopa_troopa +#include "../area.h" #include "battle/common/actor/koopa_troopa.inc.c" diff --git a/src/battle/area/dig/actor/monty_mole.c b/src/battle/area/dig/actor/monty_mole.c index 99a5aec5b7..0990516372 100644 --- a/src/battle/area/dig/actor/monty_mole.c +++ b/src/battle/area/dig/actor/monty_mole.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_dig_monty_mole +#include "../area.h" #include "battle/common/actor/monty_mole.inc.c" diff --git a/src/battle/area/dig/actor/pokey.c b/src/battle/area/dig/actor/pokey.c index 975d5be448..907725b1c3 100644 --- a/src/battle/area/dig/actor/pokey.c +++ b/src/battle/area/dig/actor/pokey.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_dig_pokey +#include "../area.h" #include "battle/common/actor/pokey.inc.c" diff --git a/src/battle/area/dig/actor/red_shy_guy.c b/src/battle/area/dig/actor/red_shy_guy.c index 6ff1660b4c..6c887e3d95 100644 --- a/src/battle/area/dig/actor/red_shy_guy.c +++ b/src/battle/area/dig/actor/red_shy_guy.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_dig_red_shy_guy +#include "../area.h" #include "battle/common/actor/red_shy_guy.inc.c" diff --git a/src/battle/area/dig/actor/tubba_blubba.c b/src/battle/area/dig/actor/tubba_blubba.c index a4a1f97f96..7dc4e75b11 100644 --- a/src/battle/area/dig/actor/tubba_blubba.c +++ b/src/battle/area/dig/actor/tubba_blubba.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BattleTubba.h" -#define NAMESPACE b_area_dig_tubba_blubba +#define NAMESPACE A(tubba_blubba) extern EvtScript N(init); extern EvtScript N(takeTurn); diff --git a/src/battle/area/dig/actor/whacka.c b/src/battle/area/dig/actor/whacka.c index f273de9284..525ec2b839 100644 --- a/src/battle/area/dig/actor/whacka.c +++ b/src/battle/area/dig/actor/whacka.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_dig_whacka +#include "../area.h" #include "battle/common/actor/whacka.inc.c" diff --git a/src/battle/area/dig/area.c b/src/battle/area/dig/area.c index d2a2906673..7adc66e768 100644 --- a/src/battle/area/dig/area.c +++ b/src/battle/area/dig/area.c @@ -1,72 +1,68 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "area.h" -#define NAMESPACE b_area_dig +extern ActorBlueprint A(fuzzy); +extern ActorBlueprint A(monty_mole); +extern ActorBlueprint A(pokey); +extern ActorBlueprint A(bandit); +extern ActorBlueprint A(red_shy_guy); +extern ActorBlueprint A(tubba_blubba); -extern ActorBlueprint N(fuzzy); -extern ActorBlueprint N(monty_mole); -extern ActorBlueprint N(pokey); -extern ActorBlueprint N(bandit); -extern ActorBlueprint N(red_shy_guy); -extern ActorBlueprint N(tubba_blubba); +extern Stage A(nok_04); +extern Stage A(iwa_01b); +extern Stage A(sbk_02); +extern Stage A(omo_04); +extern Stage A(dgb_05); -extern Stage N(dig_01); -extern Stage N(dig_02); -extern Stage N(dig_03); -extern Stage N(dig_04); -extern Stage N(dig_05); +extern EvtScript A(dig_01_script); +extern EvtScript A(dig_02_script); +extern EvtScript A(dig_03_script); +extern EvtScript A(dig_04_script); +extern EvtScript A(dig_05_script); -extern EvtScript N(dig_01_script); -extern EvtScript N(dig_02_script); -extern EvtScript N(dig_03_script); -extern EvtScript N(dig_04_script); -extern EvtScript N(dig_05_script); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_D, 7), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_C, 9), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_D, 8), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_C, 9), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_D, 8), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_C, 9), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_D, 8), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_C, 9), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_D, 8), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(red_shy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(red_shy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(red_shy_guy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(red_shy_guy), BTL_POS_GROUND_D, 7), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(red_shy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(red_shy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(red_shy_guy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(red_shy_guy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(tubba_blubba), BTL_POS_GROUND_C, 10), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(tubba_blubba), BTL_POS_GROUND_C, 10), }; -BattleList N(Formations) = { - BATTLE_WITH_SCRIPT(N(Formation_00), N(dig_01), N(dig_01_script), "ダイジェスト01"), - BATTLE_WITH_SCRIPT(N(Formation_01), N(dig_02), N(dig_02_script), "ダイジェスト02"), - BATTLE_WITH_SCRIPT(N(Formation_02), N(dig_03), N(dig_03_script), "ダイジェスト03"), - BATTLE_WITH_SCRIPT(N(Formation_03), N(dig_04), N(dig_04_script), "ダイジェスト04"), - BATTLE_WITH_SCRIPT(N(Formation_04), N(dig_05), N(dig_05_script), "ダイジェスト05"), +BattleList A(Formations) = { + BATTLE_WITH_SCRIPT(A(Formation_00), A(nok_04), A(dig_01_script), "ダイジェスト01"), + BATTLE_WITH_SCRIPT(A(Formation_01), A(iwa_01b), A(dig_02_script), "ダイジェスト02"), + BATTLE_WITH_SCRIPT(A(Formation_02), A(sbk_02), A(dig_03_script), "ダイジェスト03"), + BATTLE_WITH_SCRIPT(A(Formation_03), A(omo_04), A(dig_04_script), "ダイジェスト04"), + BATTLE_WITH_SCRIPT(A(Formation_04), A(dgb_05), A(dig_05_script), "ダイジェスト05"), {}, }; -StageList N(Stages) = { - STAGE("dig_01", N(dig_01)), - STAGE("dig_02", N(dig_02)), - STAGE("dig_03", N(dig_03)), - STAGE("dig_04", N(dig_04)), - STAGE("dig_05", N(dig_05)), +StageList A(Stages) = { + STAGE("dig_01", A(nok_04)), + STAGE("dig_02", A(iwa_01b)), + STAGE("dig_03", A(sbk_02)), + STAGE("dig_04", A(omo_04)), + STAGE("dig_05", A(dgb_05)), {}, }; diff --git a/src/battle/area/dig/area.h b/src/battle/area/dig/area.h new file mode 100644 index 0000000000..052a7d7ebb --- /dev/null +++ b/src/battle/area/dig/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_dig diff --git a/src/battle/area/dig/script/dig_01.c b/src/battle/area/dig/script/dig_01.c index a495092821..226a08e0ce 100644 --- a/src/battle/area/dig/script/dig_01.c +++ b/src/battle/area/dig/script/dig_01.c @@ -1,7 +1,6 @@ -#include "common.h" -#include "script_api/battle.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_01_script +#define NAMESPACE A(dig_01_script) #include "common/SetDemoBattleBeginDelay.inc.c" diff --git a/src/battle/area/dig/script/dig_02.c b/src/battle/area/dig/script/dig_02.c index 092022a0f7..778a07cb78 100644 --- a/src/battle/area/dig/script/dig_02.c +++ b/src/battle/area/dig/script/dig_02.c @@ -1,7 +1,6 @@ -#include "common.h" -#include "script_api/battle.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_02_script +#define NAMESPACE A(dig_02_script) API_CALLABLE(N(SetupDemoPlayerMove)) { BattleStatus* battleStatus = &gBattleStatus; diff --git a/src/battle/area/dig/script/dig_03.c b/src/battle/area/dig/script/dig_03.c index 8854022261..647a48a7f7 100644 --- a/src/battle/area/dig/script/dig_03.c +++ b/src/battle/area/dig/script/dig_03.c @@ -1,7 +1,6 @@ -#include "common.h" -#include "script_api/battle.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_03_script +#define NAMESPACE A(dig_03_script) API_CALLABLE(N(SetupDemoPlayerMove)) { BattleStatus* battleStatus = &gBattleStatus; diff --git a/src/battle/area/dig/script/dig_04.c b/src/battle/area/dig/script/dig_04.c index a145834372..3a67d2e79d 100644 --- a/src/battle/area/dig/script/dig_04.c +++ b/src/battle/area/dig/script/dig_04.c @@ -1,7 +1,6 @@ -#include "common.h" -#include "script_api/battle.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_04_script +#define NAMESPACE A(dig_04_script) API_CALLABLE(N(SetupDemoPlayerMove)) { BattleStatus* battleStatus = &gBattleStatus; diff --git a/src/battle/area/dig/script/dig_05.c b/src/battle/area/dig/script/dig_05.c index 5a65d6df07..6fea8810aa 100644 --- a/src/battle/area/dig/script/dig_05.c +++ b/src/battle/area/dig/script/dig_05.c @@ -1,7 +1,6 @@ -#include "common.h" -#include "script_api/battle.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_05_script +#define NAMESPACE A(dig_05_script) #include "common/SetDemoBattleBeginDelay.inc.c" diff --git a/src/battle/area/dig/stage/dig_01.c b/src/battle/area/dig/stage/dig_01.c index 1963a9fa78..b4d8dfbf03 100644 --- a/src/battle/area/dig/stage/dig_01.c +++ b/src/battle/area/dig/stage/dig_01.c @@ -1,35 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/nok_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_01 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_ueki2, - MODEL_ueki1, - MODEL_kabu2, - MODEL_kabu1, - MODEL_kusa3, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "nok_tex", - .shape = "nok_bt04_shape", - .hit = "nok_bt04_hit", - .bg = "nok_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_nok/nok_04.inc.c" diff --git a/src/battle/area/dig/stage/dig_02.c b/src/battle/area/dig/stage/dig_02.c index 934f99c1b9..bec473876f 100644 --- a/src/battle/area/dig/stage/dig_02.c +++ b/src/battle/area/dig/stage/dig_02.c @@ -1,34 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/iwa_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_02 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, MODEL_a, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_iwa1, - MODEL_o331, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "iwa_tex", - .shape = "iwa_bt01_shape", - .hit = "iwa_bt01_hit", - .bg = "iwa_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_iwa/iwa_01b.inc.c" diff --git a/src/battle/area/dig/stage/dig_03.c b/src/battle/area/dig/stage/dig_03.c index b0a60d2388..bff3d51efa 100644 --- a/src/battle/area/dig/stage/dig_03.c +++ b/src/battle/area/dig/stage/dig_03.c @@ -1,67 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sbk_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_03 - -#include "common/UpdateSunPos.inc.c" -#include "common/GetModelPos.inc.c" - -EvtScript N(EVS_UpdateSunPos) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar7, LVar1) - EVT_MUL(LVar7, 10) - EVT_CALL(N(GetModelPos)) - EVT_LABEL(0) - EVT_ADD(LVar7, 1) - EVT_IF_GT(LVar7, 3599) - EVT_SUB(LVar7, 3600) - EVT_END_IF - EVT_CALL(N(UpdateSunPos), LVar7, LVar0, LVar1, LVar2) - EVT_CALL(TranslateModel, LVarA, LVar0, LVar1, LVar2) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_SET(LVar0, MODEL_g60) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_UpdateSunPos)) - EVT_SET(LVar0, MODEL_g63) - EVT_SET(LVar1, 120) - EVT_EXEC(N(EVS_UpdateSunPos)) - EVT_SET(LVar0, MODEL_g62) - EVT_SET(LVar1, 240) - EVT_EXEC(N(EVS_UpdateSunPos)) - EVT_PLAY_EFFECT(EFFECT_SUN, 0, 0, 0, 0, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o322, - MODEL_o321, - MODEL_o320, - MODEL_o319, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sbk_tex", - .shape = "sbk_bt02_shape", - .hit = "sbk_bt02_hit", - .bg = "sbk_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sbk/sbk_02.inc.c" diff --git a/src/battle/area/dig/stage/dig_04.c b/src/battle/area/dig/stage/dig_04.c index 4282be3649..337743fdfa 100644 --- a/src/battle/area/dig/stage/dig_04.c +++ b/src/battle/area/dig/stage/dig_04.c @@ -1,64 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/omo_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_04 - -extern Formation N(Formation_SlotMachine); -extern ActorBlueprint N(slot_machine_stop); -extern ActorBlueprint N(slot_machine_start); - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetTexPanner, 29, TEX_PANNER_A) - EVT_THREAD - EVT_SET(LVarE, 0) - EVT_LOOP(0) - EVT_ADD(LVarE, 0x8000) - EVT_CALL(SetTexPanOffset, TEX_PANNER_A, TEX_PANNER_MAIN, LVarE, 0) - EVT_WAIT(10) - EVT_END_LOOP - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_itigo, - MODEL_kisya, - MODEL_kusari, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt04_shape", - .hit = "omo_bt04_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), - .stageEnemyCount = 4, - .stageFormation = &N(Formation_SlotMachine), -}; - -Vec3i N(slot_machine_pos1) = { -49, 56, -68 }; -Vec3i N(slot_machine_pos2) = { -13, 56, -68 }; -Vec3i N(slot_machine_pos3) = { 20, 56, -68 }; -Vec3i N(slot_machine_pos4) = { 53, 56, -68 }; - -Formation N(Formation_SlotMachine) = { - ACTOR_BY_POS(N(slot_machine_start), N(slot_machine_pos1), 0, 0), - ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos2), 0, 1), - ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos3), 0, 2), - ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos4), 0, 3), -}; - -#include "battle/common/actor/slot_machine.inc.c" +#include "battle/common/stage/area_omo/omo_04.inc.c" diff --git a/src/battle/area/dig/stage/dig_05.c b/src/battle/area/dig/stage/dig_05.c index a87d0da991..242d46611e 100644 --- a/src/battle/area/dig/stage/dig_05.c +++ b/src/battle/area/dig/stage/dig_05.c @@ -1,23 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_dig_dig_05 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "dgb_tex", - .shape = "dgb_bt05_shape", - .hit = "dgb_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_dgb/dgb_05.inc.c" diff --git a/src/battle/area/flo/actor/amazy_dayzee.c b/src/battle/area/flo/actor/amazy_dayzee.c index 3c31088a50..faa77bca24 100644 --- a/src/battle/area/flo/actor/amazy_dayzee.c +++ b/src/battle/area/flo/actor/amazy_dayzee.c @@ -1,380 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Dayzee.h" -#include "effects.h" +#include "../area.h" -#define NAMESPACE b_area_flo_amazy_dayzee - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); -extern s32 N(IdleAnimations)[]; - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 1, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 10, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 10, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 10, - STATUS_KEY_SHRINK, 10, - STATUS_KEY_STOP, 10, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, -1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, -2, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -2, 30 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -8 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_AMAZY_DAYZEE, - .level = 100, - .maxHP = 20, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 90, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 100, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 70, - .coinReward = 5, - .size = { 32, 34 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -14, 17 }, - .statusTextOffset = { 9, 25 }, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_Dayzee_Amazy_Anim01, - STATUS_KEY_STONE, ANIM_Dayzee_Amazy_Anim00, - STATUS_KEY_SLEEP, ANIM_Dayzee_Amazy_Anim0C, - STATUS_KEY_POISON, ANIM_Dayzee_Amazy_Anim01, - STATUS_KEY_STOP, ANIM_Dayzee_Amazy_Anim00, - STATUS_KEY_STATIC, ANIM_Dayzee_Amazy_Anim01, - STATUS_KEY_PARALYZE, ANIM_Dayzee_Amazy_Anim00, - STATUS_KEY_DIZZY, ANIM_Dayzee_Amazy_Anim0B, - STATUS_KEY_FEAR, ANIM_Dayzee_Amazy_Anim0B, - STATUS_END, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_LABEL(0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 15) - EVT_SUB(LVar2, 2) - EVT_PLAY_EFFECT(EFFECT_SPARKLES, 2, LVar0, LVar1, LVar2, 30, 0) - EVT_WAIT(15) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(returnHome) = { - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim09) - EVT_SET_CONST(LVar2, ANIM_Dayzee_Amazy_Anim0A) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim09) - EVT_SET_CONST(LVar2, ANIM_Dayzee_Amazy_Anim0A) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim0A) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim04) - EVT_SET_CONST(LVar2, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 1, 0) - EVT_ELSE - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 3, 0) - EVT_END_IF - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(attackPainfulSong) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorPos, ACTOR_SELF, -20, LVar1, LVar2) - EVT_ELSE - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 70) - EVT_SET(LFlag0, FALSE) - EVT_LABEL(0) - EVT_IF_EQ(LFlag0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim0E) - EVT_SET(LFlag0, TRUE) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim0F) - EVT_SET(LFlag0, FALSE) - EVT_END_IF - EVT_WAIT(1) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_IF_GT(LVar0, 0) - EVT_GOTO(0) - EVT_END_IF - EVT_IF_EQ(LFlag0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim0E) - EVT_SET(LFlag0, TRUE) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim0F) - EVT_SET(LFlag0, FALSE) - EVT_END_IF - EVT_WAIT(1) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(SetGoalPos, ACTOR_SELF, -35, 0, 10) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim01) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim06) - EVT_WAIT(40) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim07) - EVT_END_THREAD - EVT_WAIT(20) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_DAYZEE_SONG) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 25) - EVT_ADD(LVar2, 2) - EVT_LOOP(13) - EVT_CALL(RandInt, 30, LVar3) - EVT_SUB(LVar3, 15) - EVT_ADD(LVar3, LVar0) - EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 1, LVar3, LVar1, LVar2, 0) - EVT_WAIT(10) - EVT_END_LOOP - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim01) - EVT_WAIT(10) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_WAIT(15) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, DAMAGE_TYPE_NO_CONTACT, 0, DMG_STATUS_KEY(STATUS_FLAG_SLEEP, 3, 15), 20, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVarF) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(2) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 10) - EVT_WAIT(20) - EVT_CALL(YieldTurn) - EVT_EXEC_WAIT(N(returnHome)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(flee) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) - EVT_CALL(SetBattleCamZoom, 300) - EVT_CALL(SetBattleCamOffsetZ, 30) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) - EVT_CALL(MoveBattleCamOver, 30) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim03) - EVT_WAIT(10) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_WAIT(20) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(EnableActorBlur, ACTOR_SELF, 1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) - EVT_ADD(LVar0, 200) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnableActorBlur, ACTOR_SELF, 0) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_BATTLE_FLED, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_CALL(RemoveActor, ACTOR_SELF) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_EXEC_WAIT(N(attackPainfulSong)) - EVT_RETURN - EVT_END_IF - EVT_CALL(RandInt, 1000, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_LT(850) - EVT_EXEC_WAIT(N(flee)) - EVT_CASE_DEFAULT - EVT_EXEC_WAIT(N(attackPainfulSong)) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/amazy_dayzee.inc.c" diff --git a/src/battle/area/flo/actor/bzzap.c b/src/battle/area/flo/actor/bzzap.c index 9ff7939069..7b0cc78685 100644 --- a/src/battle/area/flo/actor/bzzap.c +++ b/src/battle/area/flo/actor/bzzap.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_flo_bzzap +#include "../area.h" #include "battle/common/actor/bzzap.inc.c" diff --git a/src/battle/area/flo/actor/crazee_dayzee.c b/src/battle/area/flo/actor/crazee_dayzee.c index 62b9d494bf..c3c87afe4b 100644 --- a/src/battle/area/flo/actor/crazee_dayzee.c +++ b/src/battle/area/flo/actor/crazee_dayzee.c @@ -1,391 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Dayzee.h" -#include "effects.h" +#include "../area.h" -#define NAMESPACE b_area_flo_crazee_dayzee - -extern EvtScript N(EVS_Init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); -extern s32 N(IdleAnimations)[]; - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 95, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 30, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 30, - STATUS_KEY_SHRINK, 30, - STATUS_KEY_STOP, 30, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -2, 30 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -8 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_CRAZEE_DAYZEE, - .level = 19, - .maxHP = 8, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(EVS_Init), - .statusTable = N(StatusTable), - .escapeChance = 50, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 100, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 75, - .coinReward = 2, - .size = { 32, 34 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -14, 17 }, - .statusTextOffset = { 9, 25 }, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_Dayzee_Anim01, - STATUS_KEY_STONE, ANIM_Dayzee_Anim00, - STATUS_KEY_SLEEP, ANIM_Dayzee_Anim0C, - STATUS_KEY_POISON, ANIM_Dayzee_Anim01, - STATUS_KEY_STOP, ANIM_Dayzee_Anim00, - STATUS_KEY_STATIC, ANIM_Dayzee_Anim01, - STATUS_KEY_PARALYZE, ANIM_Dayzee_Anim00, - STATUS_KEY_DIZZY, ANIM_Dayzee_Anim0B, - STATUS_KEY_FEAR, ANIM_Dayzee_Anim0B, - STATUS_END, -}; - -EvtScript N(EVS_Init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(returnHome) = { - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim09) - EVT_SET_CONST(LVar2, ANIM_Dayzee_Anim0A) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim09) - EVT_SET_CONST(LVar2, ANIM_Dayzee_Anim0A) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim0A) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim04) - EVT_SET_CONST(LVar2, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 1, 0) - EVT_ELSE - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 3, 0) - EVT_END_IF - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(attackPainfulSong) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorPos, ACTOR_SELF, -20, LVar1, LVar2) - EVT_ELSE - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 70) - EVT_SET(LFlag0, FALSE) - EVT_LABEL(0) - EVT_IF_EQ(LFlag0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim0E) - EVT_SET(LFlag0, TRUE) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim0F) - EVT_SET(LFlag0, FALSE) - EVT_END_IF - EVT_WAIT(1) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_IF_GT(LVar0, 0) - EVT_GOTO(0) - EVT_END_IF - EVT_IF_EQ(LFlag0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim0E) - EVT_SET(LFlag0, TRUE) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim0F) - EVT_SET(LFlag0, FALSE) - EVT_END_IF - EVT_WAIT(1) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(SetGoalPos, ACTOR_SELF, -35, 0, 10) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim01) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim06) - EVT_WAIT(40) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim07) - EVT_END_THREAD - EVT_WAIT(20) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_DAYZEE_SONG) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 25) - EVT_ADD(LVar2, 2) - EVT_LOOP(13) - EVT_CALL(RandInt, 30, LVar3) - EVT_SUB(LVar3, 15) - EVT_ADD(LVar3, LVar0) - EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 1, LVar3, LVar1, LVar2, 0) - EVT_WAIT(10) - EVT_END_LOOP - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim01) - EVT_WAIT(10) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_WAIT(15) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, DAMAGE_TYPE_NO_CONTACT, 0, DMG_STATUS_KEY(STATUS_FLAG_SLEEP, 3, 20), 4, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVarF) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(2) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 10) - EVT_WAIT(20) - EVT_CALL(YieldTurn) - EVT_EXEC_WAIT(N(returnHome)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(flee) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) - EVT_CALL(SetBattleCamZoom, 300) - EVT_CALL(SetBattleCamOffsetZ, 30) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) - EVT_CALL(MoveBattleCamOver, 30) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim03) - EVT_WAIT(10) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_WAIT(20) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(EnableActorBlur, ACTOR_SELF, 1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) - EVT_ADD(LVar0, 200) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnableActorBlur, ACTOR_SELF, 0) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_BATTLE_FLED, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_CALL(RemoveActor, ACTOR_SELF) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_EXEC_WAIT(N(attackPainfulSong)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) - EVT_CALL(RandInt, 100, LVar1) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(1) - EVT_IF_LT(LVar1, 80) - EVT_EXEC_WAIT(N(flee)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(2) - EVT_IF_LT(LVar1, 40) - EVT_EXEC_WAIT(N(flee)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(3) - EVT_IF_LT(LVar1, 20) - EVT_EXEC_WAIT(N(flee)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(4) - EVT_IF_LT(LVar1, 10) - EVT_EXEC_WAIT(N(flee)) - EVT_RETURN - EVT_END_IF - EVT_END_SWITCH - EVT_EXEC_WAIT(N(attackPainfulSong)) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/crazee_dayzee.inc.c" diff --git a/src/battle/area/flo/actor/green_magikoopa.c b/src/battle/area/flo/actor/green_magikoopa.c index 08280ff6ec..83b627cff9 100644 --- a/src/battle/area/flo/actor/green_magikoopa.c +++ b/src/battle/area/flo/actor/green_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_flo_green_magikoopa +#include "../area.h" #include "battle/common/actor/green_magikoopa.inc.c" diff --git a/src/battle/area/flo/actor/lakitu.c b/src/battle/area/flo/actor/lakitu.c index ccef3bc397..e6e96715c4 100644 --- a/src/battle/area/flo/actor/lakitu.c +++ b/src/battle/area/flo/actor/lakitu.c @@ -1,610 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Spiny.h" -#include "sprite/npc/Lakitu.h" -#include "effects.h" +#include "../area.h" -#define NAMESPACE b_area_flo_lakitu - -extern ActorBlueprint b_area_flo_spiny; - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_Lakitu_Anim01, - STATUS_KEY_STONE, ANIM_Lakitu_Anim00, - STATUS_KEY_SLEEP, ANIM_Lakitu_Anim08, - STATUS_KEY_POISON, ANIM_Lakitu_Anim01, - STATUS_KEY_STOP, ANIM_Lakitu_Anim00, - STATUS_KEY_STATIC, ANIM_Lakitu_Anim01, - STATUS_KEY_PARALYZE, ANIM_Lakitu_Anim00, - STATUS_KEY_DIZZY, ANIM_Lakitu_Anim09, - STATUS_KEY_FEAR, ANIM_Lakitu_Anim09, - STATUS_END, -}; - -s32 N(IdleAnimations2)[] = { - STATUS_KEY_NORMAL, ANIM_Lakitu_Anim0B, - STATUS_END, -}; - -s32 N(IdleAnimations3)[] = { - STATUS_KEY_NORMAL, ANIM_Spiny_Anim01, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_MYSTERY, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 50, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 100, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 50, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 80, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, -1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -5, 35 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -13 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 0 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations2), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 0 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations3), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_FLYING, - .type = ACTOR_TYPE_LAKITU, - .level = 20, - .maxHP = 12, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 40, - .airLiftChance = 90, - .hurricaneChance = 90, - .spookChance = 50, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 85, - .coinReward = 2, - .size = { 32, 38 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -11, 20 }, - .statusTextOffset = { 10, 34 }, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(returnHome) = { - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim03) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim05) - EVT_SET_CONST(LVar2, ANIM_Lakitu_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim05) - EVT_SET_CONST(LVar2, ANIM_Lakitu_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) - EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) - EVT_CALL(HPBarToCurrent, ACTOR_SELF) - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim03) - EVT_SET_CONST(LVar2, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(attackSpinyFlip) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim03) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, -20, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Lakitu_Anim0B) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim12) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim13) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, -3) - EVT_ADD(LVar1, 16) - EVT_ADD(LVar2, 2) - EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, EVT_FLOAT(0.4), 10, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 12) - EVT_ADD(LVar2, 0) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) - EVT_ELSE - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, -8) - EVT_ADD(LVar1, 40) - EVT_ADD(LVar2, 5) - EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 10, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 30) - EVT_ADD(LVar2, 2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_END_IF - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim15) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Lakitu_Anim0C) - EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_2, SOUND_20D2) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 20, TRUE) - EVT_SUB(LVar0, 30) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 10, TRUE) - EVT_SUB(LVar0, 20) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 5, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_WAIT(20) - EVT_CALL(YieldTurn) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, 20, TRUE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(2) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_THREAD - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 40) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 20, TRUE) - EVT_SUB(LVar0, 30) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 10, TRUE) - EVT_SUB(LVar0, 20) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 5, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_END_THREAD - EVT_WAIT(20) - EVT_CALL(YieldTurn) - EVT_EXEC_WAIT(N(returnHome)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -Vec3i N(spiny_pos) = { NPC_DISPOSE_LOCATION }; - -Formation N(formation_spiny) = { - ACTOR_BY_POS(b_area_flo_spiny, N(spiny_pos), 100, 1), -}; - -EvtScript N(summonSpiny) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_spiny)), 0) - EVT_CALL(CopyStatusEffects, ACTOR_SELF, LVar0) - EVT_SET(LVarB, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Lakitu_Anim0B) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim12) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim13) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, -3) - EVT_ADD(LVar1, 16) - EVT_ADD(LVar2, 2) - EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, EVT_FLOAT(0.4), 10, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 12) - EVT_ADD(LVar2, 0) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) - EVT_ELSE - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, -8) - EVT_ADD(LVar1, 40) - EVT_ADD(LVar2, 5) - EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 10, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 30) - EVT_ADD(LVar2, 2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_END_IF - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim15) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01) - EVT_END_THREAD - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_2, SOUND_20D2) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Lakitu_Anim0C) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.6)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 40) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 12, TRUE) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, 0, LVar2) - EVT_SUB(LVar0, 30) - EVT_THREAD - EVT_CALL(SetPartRotationOffset, ACTOR_SELF, PRT_3, 0, 16, 0) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_SET(LFlag0, FALSE) - EVT_LOOP(12) - EVT_ADD(LVar0, 30) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, LVar0) - EVT_ADD(LVar1, 1) - EVT_IF_GE(LVar1, 6) - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_SET(LFlag0, FALSE) - EVT_ELSE - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_3, EVT_FLOAT(1.3)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_3, LVar0, 0, LVar2, 12, TRUE) - EVT_END_THREAD - EVT_WAIT(1) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.3)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 12, TRUE) - EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 1, LVar0, 0, LVar2, 0, 0) - EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_CALL(SetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(SetAnimation, LVarB, 1, ANIM_Spiny_Anim01) - EVT_WAIT(20) - EVT_CALL(SetAnimation, LVarB, 1, ANIM_Spiny_Anim04) - EVT_CALL(SetGoalToIndex, LVarB, LVarA) - EVT_CALL(GetGoalPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(GetActorPos, LVarB, LVar3, LVar4, LVar5) - EVT_IF_LT(LVar0, LVar3) - EVT_CALL(SetActorYaw, LVarB, 0) - EVT_ELSE - EVT_CALL(SetActorYaw, LVarB, 180) - EVT_END_IF - EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, LVarB, 0, FALSE) - EVT_CALL(SetAnimation, LVarB, 1, ANIM_Spiny_Anim01) - EVT_CALL(SetActorYaw, LVarB, 0) - EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(HPBarToHome, LVarB) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_ADD(LVar0, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, LVar0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(findPlacesForSummon) = { - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar5) - EVT_CALL(GetIndexFromHome, LVar0, LVar5) - EVT_MOD(LVar5, 4) - EVT_SWITCH(LVar5) - EVT_CASE_EQ(0) - EVT_SET(LFlag1, TRUE) - EVT_CASE_EQ(1) - EVT_SET(LFlag2, TRUE) - EVT_CASE_EQ(2) - EVT_SET(LFlag3, TRUE) - EVT_CASE_EQ(3) - EVT_SET(LFlag4, TRUE) - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_IF_EQ(LFlag1, FALSE) - EVT_SET(LVarA, 0) - EVT_RETURN - EVT_END_IF - EVT_IF_EQ(LFlag2, FALSE) - EVT_SET(LVarA, 1) - EVT_RETURN - EVT_END_IF - EVT_IF_EQ(LFlag3, FALSE) - EVT_SET(LVarA, 2) - EVT_RETURN - EVT_END_IF - EVT_IF_EQ(LFlag4, FALSE) - EVT_SET(LVarA, 3) - EVT_RETURN - EVT_END_IF - EVT_SET(LVarA, -1) - EVT_RETURN - EVT_END -}; - -EvtScript N(calcSummonChance) = { - EVT_SET(LVar9, 0) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetOriginalActorType, LVar0, LVar2) - EVT_SWITCH(LVar2) - EVT_CASE_EQ(ACTOR_TYPE_LAKITU) - EVT_CALL(GetStatusFlags, LVar0, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(GetActorVar, LVar0, 0, LVar3) - EVT_IF_LT(LVar3, 3) - EVT_ADD(LVar9, 1) - EVT_END_IF - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_GE(LVar0, 3) - EVT_EXEC_WAIT(N(attackSpinyFlip)) - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(findPlacesForSummon)) - EVT_IF_EQ(LVarA, -1) - EVT_EXEC_WAIT(N(attackSpinyFlip)) - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(calcSummonChance)) - EVT_SWITCH(LVar9) - EVT_CASE_EQ(1) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 500) - EVT_EXEC_WAIT(N(summonSpiny)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(2) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 250) - EVT_EXEC_WAIT(N(summonSpiny)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(3) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 150) - EVT_EXEC_WAIT(N(summonSpiny)) - EVT_RETURN - EVT_END_IF - EVT_END_SWITCH - EVT_EXEC_WAIT(N(attackSpinyFlip)) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/lakitu.inc.c" diff --git a/src/battle/area/flo/actor/medi_guy.c b/src/battle/area/flo/actor/medi_guy.c index 1147caa5a2..467cbb55b5 100644 --- a/src/battle/area/flo/actor/medi_guy.c +++ b/src/battle/area/flo/actor/medi_guy.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_flo_medi_guy +#include "../area.h" #include "battle/common/actor/medi_guy.inc.c" diff --git a/src/battle/area/flo/actor/red_magikoopa.c b/src/battle/area/flo/actor/red_magikoopa.c index 6062a92cb3..b61876c1b6 100644 --- a/src/battle/area/flo/actor/red_magikoopa.c +++ b/src/battle/area/flo/actor/red_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_flo_red_magikoopa +#include "../area.h" #include "battle/common/actor/red_magikoopa.inc.c" diff --git a/src/battle/area/flo/actor/ruff_puff.c b/src/battle/area/flo/actor/ruff_puff.c index a7bc405d2b..f694931208 100644 --- a/src/battle/area/flo/actor/ruff_puff.c +++ b/src/battle/area/flo/actor/ruff_puff.c @@ -1,347 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/TuffPuff.h" +#include "../area.h" -#define NAMESPACE b_area_flo_ruff_puff - -extern EvtScript N(EVS_Init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_TuffPuff_Idle, - STATUS_KEY_STONE, ANIM_TuffPuff_Still, - STATUS_KEY_SLEEP, ANIM_TuffPuff_Sleep, - STATUS_KEY_POISON, ANIM_TuffPuff_Idle, - STATUS_KEY_STOP, ANIM_TuffPuff_Still, - STATUS_KEY_STATIC, ANIM_TuffPuff_Idle, - STATUS_KEY_PARALYZE, ANIM_TuffPuff_Still, - STATUS_KEY_DIZZY, ANIM_TuffPuff_Dizzy, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_MYSTERY, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 50, - STATUS_KEY_POISON, 90, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 100, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 70, - STATUS_KEY_PARALYZE, 40, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 80, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, -1, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -2, 26 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -13 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_FLYING, - .type = ACTOR_TYPE_RUFF_PUFF, - .level = 19, - .maxHP = 10, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(EVS_Init), - .statusTable = N(StatusTable), - .escapeChance = 50, - .airLiftChance = 90, - .hurricaneChance = 90, - .spookChance = 40, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 80, - .coinReward = 2, - .size = { 32, 32 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(EVS_Init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -#include "common/CosInterpMinMax.inc.c" - -EvtScript N(idle) = { - EVT_SET(LVarF, 0) - EVT_LOOP(0) - EVT_CALL(N(CosInterpMinMax), LVarF, LVar0, EVT_FLOAT(0.97), EVT_FLOAT(1.03), 15, 0, 0) - EVT_CALL(N(CosInterpMinMax), LVarF, LVar1, EVT_FLOAT(1.03), EVT_FLOAT(0.97), 15, 0, 0) - EVT_ADD(LVarF, 1) - EVT_CALL(SetActorScale, ACTOR_SELF, LVar1, LVar0, EVT_FLOAT(1.0)) - EVT_IF_GE(LVarF, 30) - EVT_SET(LVarF, 0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(returnHome) = { - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_TuffPuff_Run) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_SIN_OUT) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_TuffPuff_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_TuffPuff_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) - EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) - EVT_CALL(HPBarToCurrent, ACTOR_SELF) - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Run) - EVT_SET_CONST(LVar2, ANIM_TuffPuff_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_TuffPuff_Run) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_TuffPuff_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_TuffPuff_Idle) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_TuffPuff_Grin) - EVT_WAIT(5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, 0, LVar2) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SETF(LVar0, EVT_FLOAT(0.0)) - EVT_LOOP(15) - EVT_ADDF(LVar0, EVT_FLOAT(12.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(AddGoalPos, ACTOR_SELF, -10, 0, 0) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SETF(LVar0, EVT_FLOAT(180.0)) - EVT_LOOP(10) - EVT_ADDF(LVar0, EVT_FLOAT(18.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(AddGoalPos, ACTOR_SELF, -30, 0, 0) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(AddGoalPos, ACTOR_SELF, -20, 0, 0) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(AddGoalPos, ACTOR_SELF, -10, 0, 0) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 13, 0) - EVT_SETF(LVar0, EVT_FLOAT(0.0)) - EVT_LOOP(8) - EVT_ADDF(LVar0, EVT_FLOAT(22.5)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(2) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SETF(LVar0, EVT_FLOAT(180.0)) - EVT_LOOP(10) - EVT_SUBF(LVar0, EVT_FLOAT(22.5)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(JumpWithBounce, ACTOR_SELF, 10, EVT_FLOAT(5.0)) - EVT_WAIT(10) - EVT_CALL(YieldTurn) - EVT_EXEC_WAIT(N(returnHome)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/ruff_puff.inc.c" diff --git a/src/battle/area/flo/actor/spiny.c b/src/battle/area/flo/actor/spiny.c index bfb5d64228..660440d73b 100644 --- a/src/battle/area/flo/actor/spiny.c +++ b/src/battle/area/flo/actor/spiny.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_flo_spiny +#include "../area.h" #include "battle/common/actor/spiny.inc.c" diff --git a/src/battle/area/flo/actor/white_magikoopa.c b/src/battle/area/flo/actor/white_magikoopa.c index 8c0e881821..8e56b247f1 100644 --- a/src/battle/area/flo/actor/white_magikoopa.c +++ b/src/battle/area/flo/actor/white_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_flo_white_magikoopa +#include "../area.h" #include "battle/common/actor/white_magikoopa.inc.c" diff --git a/src/battle/area/flo/actor/yellow_magikoopa.c b/src/battle/area/flo/actor/yellow_magikoopa.c index 1886d73b8b..bbc5059838 100644 --- a/src/battle/area/flo/actor/yellow_magikoopa.c +++ b/src/battle/area/flo/actor/yellow_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_flo_yellow_magikoopa +#include "../area.h" #include "battle/common/actor/yellow_magikoopa.inc.c" diff --git a/src/battle/area/flo/area.c b/src/battle/area/flo/area.c index 7fd89c45b6..db6b574068 100644 --- a/src/battle/area/flo/area.c +++ b/src/battle/area/flo/area.c @@ -1,297 +1,294 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_flo +extern ActorBlueprint A(lakitu); +extern ActorBlueprint A(ruff_puff); +extern ActorBlueprint A(bzzap); +extern ActorBlueprint A(crazee_dayzee); +extern ActorBlueprint A(spiny); +extern ActorBlueprint A(white_magikoopa); +extern ActorBlueprint A(red_magikoopa); +extern ActorBlueprint A(yellow_magikoopa); +extern ActorBlueprint A(medi_guy); +extern ActorBlueprint A(amazy_dayzee); +extern ActorBlueprint A(green_magikoopa_flying); +extern ActorBlueprint A(yellow_magikoopa_flying); -extern ActorBlueprint N(lakitu); -extern ActorBlueprint N(ruff_puff); -extern ActorBlueprint N(bzzap); -extern ActorBlueprint N(crazee_dayzee); -extern ActorBlueprint N(spiny); -extern ActorBlueprint N(white_magikoopa); -extern ActorBlueprint N(red_magikoopa); -extern ActorBlueprint N(yellow_magikoopa); -extern ActorBlueprint N(medi_guy); -extern ActorBlueprint N(amazy_dayzee); -extern ActorBlueprint N(green_magikoopa_flying); -extern ActorBlueprint N(yellow_magikoopa_flying); +extern Stage A(flo_01); +extern Stage A(flo_01b); +extern Stage A(flo_01c); +extern Stage A(flo_02); +extern Stage A(flo_02b); +extern Stage A(flo_02c); +extern Stage A(flo_03); +extern Stage A(flo_04); +extern Stage A(flo_05); +extern Stage A(flo_06); -extern Stage N(flo_01); -extern Stage N(flo_01b); -extern Stage N(flo_01c); -extern Stage N(flo_02); -extern Stage N(flo_02b); -extern Stage N(flo_02c); -extern Stage N(flo_03); -extern Stage N(flo_04); -extern Stage N(flo_05); -extern Stage N(flo_06); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_C, 8), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_C, 8), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_C, 9), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_C, 9), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 8), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 8), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_D, 7), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_D, 7), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_C, 9), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_C, 9), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_D, 7), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_D, 7), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(white_magikoopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(white_magikoopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(red_magikoopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(red_magikoopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(yellow_magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(yellow_magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_C, 9), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_C, 8), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_B, 10), +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_C, 9), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_11) = { - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_C, 8), +Formation A(Formation_11) = { + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_12) = { - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_D, 7), +Formation A(Formation_12) = { + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_13) = { - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 9), +Formation A(Formation_13) = { + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 9), }; -Formation N(Formation_14) = { - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 8), +Formation A(Formation_14) = { + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 8), }; -Formation N(Formation_15) = { - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 8), +Formation A(Formation_15) = { + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 8), }; -Formation N(Formation_16) = { - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(amazy_dayzee), BTL_POS_GROUND_C, 8), +Formation A(Formation_16) = { + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(amazy_dayzee), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_17) = { - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 9), +Formation A(Formation_17) = { + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 9), }; -Formation N(Formation_18) = { - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 8), +Formation A(Formation_18) = { + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 8), }; -Formation N(Formation_19) = { - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(green_magikoopa_flying), BTL_POS_AIR_C, 8), +Formation A(Formation_19) = { + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(green_magikoopa_flying), BTL_POS_AIR_C, 8), }; -Formation N(Formation_1A) = { - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_C, 9), +Formation A(Formation_1A) = { + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_C, 9), }; -Formation N(Formation_1B) = { - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 8), +Formation A(Formation_1B) = { + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 8), }; -Formation N(Formation_1C) = { - ACTOR_BY_IDX(N(amazy_dayzee), BTL_POS_GROUND_B, 10), +Formation A(Formation_1C) = { + ACTOR_BY_IDX(A(amazy_dayzee), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_1D) = { - ACTOR_BY_IDX(N(amazy_dayzee), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 8), +Formation A(Formation_1D) = { + ACTOR_BY_IDX(A(amazy_dayzee), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 8), }; -Formation N(Formation_1E) = { - ACTOR_BY_IDX(N(amazy_dayzee), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(amazy_dayzee), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(amazy_dayzee), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(amazy_dayzee), BTL_POS_GROUND_D, 7), +Formation A(Formation_1E) = { + ACTOR_BY_IDX(A(amazy_dayzee), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(amazy_dayzee), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(amazy_dayzee), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(amazy_dayzee), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_1F) = { - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_C, 9), +Formation A(Formation_1F) = { + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_C, 9), }; -Formation N(Formation_20) = { - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_D, 7), +Formation A(Formation_20) = { + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_D, 7), }; -Formation N(Formation_21) = { - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(lakitu), BTL_POS_AIR_C, 9), +Formation A(Formation_21) = { + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(lakitu), BTL_POS_AIR_C, 9), }; -Formation N(Formation_22) = { - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 8), +Formation A(Formation_22) = { + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 8), }; -Formation N(Formation_23) = { - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(crazee_dayzee), BTL_POS_GROUND_C, 8), +Formation A(Formation_23) = { + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(crazee_dayzee), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_24) = { - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(ruff_puff), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(yellow_magikoopa_flying), BTL_POS_AIR_C, 8), +Formation A(Formation_24) = { + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(ruff_puff), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(yellow_magikoopa_flying), BTL_POS_AIR_C, 8), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(flo_01), "ジュゲムx2"), - BATTLE(N(Formation_01), N(flo_01), "ジュゲムx3"), - BATTLE(N(Formation_02), N(flo_01), "ジュゲム,クモクモーン"), - BATTLE(N(Formation_03), N(flo_01), "ジュゲム,ハッチーx2"), - BATTLE(N(Formation_04), N(flo_01), "ジュゲム,ハッチー,ジュゲム,ハッチー"), - BATTLE(N(Formation_05), N(flo_01), "ジュゲム,パンジー"), - BATTLE(N(Formation_06), N(flo_01), "ジュゲム,トゲゾー"), - BATTLE(N(Formation_07), N(flo_01), "ジュゲムx2,トゲゾーx2"), - BATTLE(N(Formation_08), N(flo_01), "ジュゲムx3,トゲゾー"), - BATTLE(N(Formation_09), N(flo_01), "ジュゲムx2,ホワイトカメック"), - BATTLE(N(Formation_0A), N(flo_01), "ジュゲムx2,レッドカメック"), - BATTLE(N(Formation_0B), N(flo_01), "ジュゲムx3,イエローカメック"), - BATTLE(N(Formation_0C), N(flo_01), "トゲゾーx2"), - BATTLE(N(Formation_0D), N(flo_01), "トゲゾーx3"), - BATTLE(N(Formation_0E), N(flo_01), "トゲゾー,パンジーさん,かいふくヘイホー"), - BATTLE(N(Formation_0F), N(flo_01), "パンジーさん"), - BATTLE(N(Formation_10), N(flo_01), "パンジーさんx2"), - BATTLE(N(Formation_11), N(flo_01), "パンジーさんx3"), - BATTLE(N(Formation_12), N(flo_01), "パンジーさんx4"), - BATTLE(N(Formation_13), N(flo_01), "パンジーさん,ハッチー"), - BATTLE(N(Formation_14), N(flo_01), "パンジーさん,ハッチーx2"), - BATTLE(N(Formation_15), N(flo_01), "パンジーさんx2,ハッチー"), - BATTLE(N(Formation_16), N(flo_01), "パンジーさんx2,きらめくパンジーさん"), - BATTLE(N(Formation_17), N(flo_01), "ハッチーx2"), - BATTLE(N(Formation_18), N(flo_01), "ハッチーx3"), - BATTLE(N(Formation_19), N(flo_01), "ハッチーx2,グリーンカメック(そら)"), - BATTLE(N(Formation_1A), N(flo_01), "ハッチー,クモクモーン"), - BATTLE(N(Formation_1B), N(flo_01), "ハッチー,クモクモーン,ハッチー"), - BATTLE(N(Formation_1C), N(flo_01), "きらめくパンジーさん"), - BATTLE(N(Formation_1D), N(flo_01), "きらめくパンジーさん,ハッチーx2"), - BATTLE(N(Formation_1E), N(flo_01), "きらめくパンジーさんx4"), - BATTLE(N(Formation_1F), N(flo_01), "クモクモーンx2"), - BATTLE(N(Formation_20), N(flo_01), "クモクモーンx4"), - BATTLE(N(Formation_21), N(flo_01), "クモクモーン,ジュゲム"), - BATTLE(N(Formation_22), N(flo_01), "クモクモーンx2,ハッチー"), - BATTLE(N(Formation_23), N(flo_01), "クモクモーンx2,パンジー"), - BATTLE(N(Formation_24), N(flo_01), "クモクモーンx2,イエローカメック(そら)"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(flo_01), "ジュゲムx2"), + BATTLE(A(Formation_01), A(flo_01), "ジュゲムx3"), + BATTLE(A(Formation_02), A(flo_01), "ジュゲム,クモクモーン"), + BATTLE(A(Formation_03), A(flo_01), "ジュゲム,ハッチーx2"), + BATTLE(A(Formation_04), A(flo_01), "ジュゲム,ハッチー,ジュゲム,ハッチー"), + BATTLE(A(Formation_05), A(flo_01), "ジュゲム,パンジー"), + BATTLE(A(Formation_06), A(flo_01), "ジュゲム,トゲゾー"), + BATTLE(A(Formation_07), A(flo_01), "ジュゲムx2,トゲゾーx2"), + BATTLE(A(Formation_08), A(flo_01), "ジュゲムx3,トゲゾー"), + BATTLE(A(Formation_09), A(flo_01), "ジュゲムx2,ホワイトカメック"), + BATTLE(A(Formation_0A), A(flo_01), "ジュゲムx2,レッドカメック"), + BATTLE(A(Formation_0B), A(flo_01), "ジュゲムx3,イエローカメック"), + BATTLE(A(Formation_0C), A(flo_01), "トゲゾーx2"), + BATTLE(A(Formation_0D), A(flo_01), "トゲゾーx3"), + BATTLE(A(Formation_0E), A(flo_01), "トゲゾー,パンジーさん,かいふくヘイホー"), + BATTLE(A(Formation_0F), A(flo_01), "パンジーさん"), + BATTLE(A(Formation_10), A(flo_01), "パンジーさんx2"), + BATTLE(A(Formation_11), A(flo_01), "パンジーさんx3"), + BATTLE(A(Formation_12), A(flo_01), "パンジーさんx4"), + BATTLE(A(Formation_13), A(flo_01), "パンジーさん,ハッチー"), + BATTLE(A(Formation_14), A(flo_01), "パンジーさん,ハッチーx2"), + BATTLE(A(Formation_15), A(flo_01), "パンジーさんx2,ハッチー"), + BATTLE(A(Formation_16), A(flo_01), "パンジーさんx2,きらめくパンジーさん"), + BATTLE(A(Formation_17), A(flo_01), "ハッチーx2"), + BATTLE(A(Formation_18), A(flo_01), "ハッチーx3"), + BATTLE(A(Formation_19), A(flo_01), "ハッチーx2,グリーンカメック(そら)"), + BATTLE(A(Formation_1A), A(flo_01), "ハッチー,クモクモーン"), + BATTLE(A(Formation_1B), A(flo_01), "ハッチー,クモクモーン,ハッチー"), + BATTLE(A(Formation_1C), A(flo_01), "きらめくパンジーさん"), + BATTLE(A(Formation_1D), A(flo_01), "きらめくパンジーさん,ハッチーx2"), + BATTLE(A(Formation_1E), A(flo_01), "きらめくパンジーさんx4"), + BATTLE(A(Formation_1F), A(flo_01), "クモクモーンx2"), + BATTLE(A(Formation_20), A(flo_01), "クモクモーンx4"), + BATTLE(A(Formation_21), A(flo_01), "クモクモーン,ジュゲム"), + BATTLE(A(Formation_22), A(flo_01), "クモクモーンx2,ハッチー"), + BATTLE(A(Formation_23), A(flo_01), "クモクモーンx2,パンジー"), + BATTLE(A(Formation_24), A(flo_01), "クモクモーンx2,イエローカメック(そら)"), {}, }; -StageList N(Stages) = { - STAGE("flo_01", N(flo_01)), - STAGE("flo_01b", N(flo_01b)), - STAGE("flo_01c", N(flo_01c)), - STAGE("flo_02", N(flo_02)), - STAGE("flo_02b", N(flo_02b)), - STAGE("flo_02c", N(flo_02c)), - STAGE("flo_03", N(flo_03)), - STAGE("flo_04", N(flo_04)), - STAGE("flo_05", N(flo_05)), - STAGE("flo_06", N(flo_06)), +StageList A(Stages) = { + STAGE("flo_01", A(flo_01)), + STAGE("flo_01b", A(flo_01b)), + STAGE("flo_01c", A(flo_01c)), + STAGE("flo_02", A(flo_02)), + STAGE("flo_02b", A(flo_02b)), + STAGE("flo_02c", A(flo_02c)), + STAGE("flo_03", A(flo_03)), + STAGE("flo_04", A(flo_04)), + STAGE("flo_05", A(flo_05)), + STAGE("flo_06", A(flo_06)), {}, }; diff --git a/src/battle/area/flo/area.h b/src/battle/area/flo/area.h new file mode 100644 index 0000000000..1f246a0aae --- /dev/null +++ b/src/battle/area/flo/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_flo diff --git a/src/battle/area/flo/stage/flo_01.c b/src/battle/area/flo/stage/flo_01.c index df2026ddd4..c49e822802 100644 --- a/src/battle/area/flo/stage/flo_01.c +++ b/src/battle/area/flo/stage/flo_01.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_01 - -#include "battle/common/stage/flo_01.inc.c" +#include "battle/common/stage/area_flo/flo_01.inc.c" diff --git a/src/battle/area/flo/stage/flo_01b.c b/src/battle/area/flo/stage/flo_01b.c index 696ddc9a0d..7429e06fe7 100644 --- a/src/battle/area/flo/stage/flo_01b.c +++ b/src/battle/area/flo/stage/flo_01b.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_01b - -#include "battle/common/stage/flo_01b.inc.c" +#include "battle/common/stage/area_flo/flo_01b.inc.c" diff --git a/src/battle/area/flo/stage/flo_01c.c b/src/battle/area/flo/stage/flo_01c.c index a54397aa2e..9de89ddfe1 100644 --- a/src/battle/area/flo/stage/flo_01c.c +++ b/src/battle/area/flo/stage/flo_01c.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_01c - -#include "battle/common/stage/flo_01c.inc.c" +#include "battle/common/stage/area_flo/flo_01c.inc.c" diff --git a/src/battle/area/flo/stage/flo_02.c b/src/battle/area/flo/stage/flo_02.c index 36e50e1d91..90fb03f617 100644 --- a/src/battle/area/flo/stage/flo_02.c +++ b/src/battle/area/flo/stage/flo_02.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_02 - -#include "battle/common/stage/flo_02.inc.c" +#include "battle/common/stage/area_flo/flo_02.inc.c" diff --git a/src/battle/area/flo/stage/flo_02b.c b/src/battle/area/flo/stage/flo_02b.c index 8c59279033..5980c6a079 100644 --- a/src/battle/area/flo/stage/flo_02b.c +++ b/src/battle/area/flo/stage/flo_02b.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_02b - -#include "battle/common/stage/flo_02b.inc.c" +#include "battle/common/stage/area_flo/flo_02b.inc.c" diff --git a/src/battle/area/flo/stage/flo_02c.c b/src/battle/area/flo/stage/flo_02c.c index a994e62882..c2b1dc1f36 100644 --- a/src/battle/area/flo/stage/flo_02c.c +++ b/src/battle/area/flo/stage/flo_02c.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_02c - -#include "battle/common/stage/flo_02c.inc.c" +#include "battle/common/stage/area_flo/flo_02c.inc.c" diff --git a/src/battle/area/flo/stage/flo_03.c b/src/battle/area/flo/stage/flo_03.c index b59be9e8d1..94240ec958 100644 --- a/src/battle/area/flo/stage/flo_03.c +++ b/src/battle/area/flo/stage/flo_03.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt03_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_03 - -#include "battle/common/stage/flo_03.inc.c" +#include "battle/common/stage/area_flo/flo_03.inc.c" diff --git a/src/battle/area/flo/stage/flo_04.c b/src/battle/area/flo/stage/flo_04.c index a0214bee84..0157e4f01a 100644 --- a/src/battle/area/flo/stage/flo_04.c +++ b/src/battle/area/flo/stage/flo_04.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_04 - -#include "battle/common/stage/flo_04.inc.c" +#include "battle/common/stage/area_flo/flo_04.inc.c" diff --git a/src/battle/area/flo/stage/flo_05.c b/src/battle/area/flo/stage/flo_05.c index 44cdc19fe4..a455219292 100644 --- a/src/battle/area/flo/stage/flo_05.c +++ b/src/battle/area/flo/stage/flo_05.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_05 - -#include "battle/common/stage/flo_05.inc.c" +#include "battle/common/stage/area_flo/flo_05.inc.c" diff --git a/src/battle/area/flo/stage/flo_06.c b/src/battle/area/flo/stage/flo_06.c index bfb2c48874..a234a2d83b 100644 --- a/src/battle/area/flo/stage/flo_06.c +++ b/src/battle/area/flo/stage/flo_06.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_flo_flo_06 - -#include "battle/common/stage/flo_06.inc.c" +#include "battle/common/stage/area_flo/flo_06.inc.c" diff --git a/src/battle/area/flo2/actor/huff_n_puff.c b/src/battle/area/flo2/actor/huff_n_puff.c index 0f573db0f7..995e6b899d 100644 --- a/src/battle/area/flo2/actor/huff_n_puff.c +++ b/src/battle/area/flo2/actor/huff_n_puff.c @@ -1,13 +1,10 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/HuffNPuff.h" #include "sprite/npc/RuffPuff.h" -#include "effects.h" #include "battle/action_cmd/whirlwind.h" #include "battle/action_cmd/stop_leech.h" -#define NAMESPACE b_area_flo2_huff_n_puff +#define NAMESPACE A(huff_n_puff) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -38,7 +35,7 @@ enum N(Flags) { N(FLAG_SPEAK_4) = 0x80, }; -extern ActorBlueprint b_area_flo2_tuff_puff; +extern ActorBlueprint A(tuff_puff); extern EvtScript N(EVS_Init); extern EvtScript N(takeTurn); @@ -548,11 +545,11 @@ EvtScript N(idle) = { Vec3i N(tuff_puff_pos) = { NPC_DISPOSE_LOCATION }; Formation N(formation_tuff_puff_small) = { - ACTOR_BY_POS(b_area_flo2_tuff_puff, N(tuff_puff_pos), 0), + ACTOR_BY_POS(A(tuff_puff), N(tuff_puff_pos), 0), }; Formation N(formation_tuff_puff_large) = { - ACTOR_BY_POS(b_area_flo2_tuff_puff, N(tuff_puff_pos), 0, 1), + ACTOR_BY_POS(A(tuff_puff), N(tuff_puff_pos), 0, 1), }; EvtScript N(spawnTuffPuff) = { @@ -611,10 +608,10 @@ EvtScript N(spawnTuffPuff) = { EVT_CALL(SetTuffPuffPriority) EVT_IF_GT(LVarA, 0) EVT_SUB(LVarA, 1) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_tuff_puff_large)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_tuff_puff_large)), FALSE) EVT_CALL(SetActorVar, LVar0, 5, 2) EVT_ELSE - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_tuff_puff_small)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_tuff_puff_small)), FALSE) EVT_CALL(SetActorVar, LVar0, 5, 1) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_TUFF_PUFF_BIT_ARRAY), LVar1) diff --git a/src/battle/area/flo2/actor/monty_mole_boss.c b/src/battle/area/flo2/actor/monty_mole_boss.c index 929ab1b87c..4c8184f4bf 100644 --- a/src/battle/area/flo2/actor/monty_mole_boss.c +++ b/src/battle/area/flo2/actor/monty_mole_boss.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/MontyMole.h" -#include "effects.h" -#define NAMESPACE b_area_flo2_monty_mole_boss +#define NAMESPACE A(monty_mole_boss) extern s32 N(IdleAnimations)[]; extern s32 N(IdleAnimations2)[]; @@ -201,9 +198,9 @@ Formation N(formation_hole_2) = { EvtScript N(onDeath) = { EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_hole_2)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_hole_2)), FALSE) EVT_ELSE - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_hole_1)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_hole_1)), FALSE) EVT_END_IF EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) EVT_SUB(LVar3, 1) @@ -239,29 +236,29 @@ EvtScript N(handleEvent) = { EVT_WAIT(8) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Dark_Anim07) EVT_END_CHILD_THREAD - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Dark_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Dark_Anim08) EVT_WAIT(10) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Dark_Anim05) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Dark_Anim0A) EVT_SET_CONST(LVar2, ANIM_MontyMole_Dark_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Dark_Anim0A) EVT_SET_CONST(LVar2, ANIM_MontyMole_Dark_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(onDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Dark_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -280,19 +277,19 @@ EvtScript N(handleEvent) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Dark_Anim14) EVT_WAIT(20) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Dark_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Dark_Anim05) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Dark_Anim06) EVT_WAIT(10) EVT_EXEC_WAIT(N(onDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Dark_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -314,7 +311,7 @@ EvtScript N(handleEvent) = { EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_hole))) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Dark_Anim05) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) diff --git a/src/battle/area/flo2/actor/spike.c b/src/battle/area/flo2/actor/spike.c index fd27b6f34c..1a3da4d2a8 100644 --- a/src/battle/area/flo2/actor/spike.c +++ b/src/battle/area/flo2/actor/spike.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BattleLakilester.h" -#include "effects.h" -#define NAMESPACE b_area_flo2_spike +#define NAMESPACE A(spike) extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -144,65 +141,65 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -213,21 +210,21 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(returnHome)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Run) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/area/flo2/actor/tuff_puff.c b/src/battle/area/flo2/actor/tuff_puff.c index e9bf87753c..6a5bf20bd3 100644 --- a/src/battle/area/flo2/actor/tuff_puff.c +++ b/src/battle/area/flo2/actor/tuff_puff.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/RuffPuff.h" -#include "effects.h" -#define NAMESPACE b_area_flo2_tuff_puff +#define NAMESPACE A(tuff_puff) extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -251,7 +248,7 @@ EvtScript N(handleEvent) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim0C) @@ -260,7 +257,7 @@ EvtScript N(handleEvent) = { EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim0C) @@ -299,7 +296,7 @@ EvtScript N(handleEvent) = { EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(onDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim0F) @@ -309,7 +306,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim02) @@ -318,7 +315,7 @@ EvtScript N(handleEvent) = { EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim02) @@ -327,7 +324,7 @@ EvtScript N(handleEvent) = { EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim0C) @@ -336,7 +333,7 @@ EvtScript N(handleEvent) = { EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(onDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim0C) @@ -346,7 +343,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim02) @@ -355,7 +352,7 @@ EvtScript N(handleEvent) = { EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim06) @@ -365,7 +362,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) EVT_EXEC_WAIT(N(onDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim0C) @@ -375,7 +372,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_IS_BIG), LVar1) EVT_IF_EQ(LVar1, 0) EVT_SET_CONST(LVar1, ANIM_RuffPuff_Anim02) diff --git a/src/battle/area/flo2/area.c b/src/battle/area/flo2/area.c index 589e12cac8..97dc58171d 100644 --- a/src/battle/area/flo2/area.c +++ b/src/battle/area/flo2/area.c @@ -1,75 +1,72 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_flo2 +extern ActorBlueprint A(huff_n_puff); +extern ActorBlueprint A(monty_mole_boss); +extern ActorBlueprint A(spike); -extern ActorBlueprint N(huff_n_puff); -extern ActorBlueprint N(monty_mole_boss); -extern ActorBlueprint N(spike); +extern Stage A(flo_01); +extern Stage A(flo_01b); +extern Stage A(flo_01c); +extern Stage A(flo_02); +extern Stage A(flo_02b); +extern Stage A(flo_02c); +extern Stage A(flo_03); +extern Stage A(flo_04); +extern Stage A(flo_05); +extern Stage A(flo_06); -extern Stage N(flo_01); -extern Stage N(flo_01b); -extern Stage N(flo_01c); -extern Stage N(flo_02); -extern Stage N(flo_02b); -extern Stage N(flo_02c); -extern Stage N(flo_03); -extern Stage N(flo_04); -extern Stage N(flo_05); -extern Stage N(flo_06); +Vec3i A(huff_n_puff_pos) = { 80, 80, 0 }; -Vec3i N(huff_n_puff_pos) = { 80, 80, 0 }; - -Formation N(Formation_01) = { - ACTOR_BY_POS(N(huff_n_puff), N(huff_n_puff_pos), 10), +Formation A(Formation_01) = { + ACTOR_BY_POS(A(huff_n_puff), A(huff_n_puff_pos), 10), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_B, 10), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_C, 9), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_C, 8), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(monty_mole_boss), BTL_POS_GROUND_D, 7), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(monty_mole_boss), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(spike), BTL_POS_AIR_B, 10), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(spike), BTL_POS_AIR_B, 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_01), N(flo_04), "オズモーン"), - BATTLE(N(Formation_02), N(flo_01), "フラワーチョロプー"), - BATTLE(N(Formation_03), N(flo_01), "フラワーチョロプーx2"), - BATTLE(N(Formation_04), N(flo_01), "フラワーチョロプーx3"), - BATTLE(N(Formation_05), N(flo_01), "フラワーチョロプーx4"), - BATTLE(N(Formation_06), N(flo_01), "ジョナサン?"), +BattleList A(Formations) = { + BATTLE(A(Formation_01), A(flo_04), "オズモーン"), + BATTLE(A(Formation_02), A(flo_01), "フラワーチョロプー"), + BATTLE(A(Formation_03), A(flo_01), "フラワーチョロプーx2"), + BATTLE(A(Formation_04), A(flo_01), "フラワーチョロプーx3"), + BATTLE(A(Formation_05), A(flo_01), "フラワーチョロプーx4"), + BATTLE(A(Formation_06), A(flo_01), "ジョナサン?"), {}, }; -StageList N(Stages) = { - STAGE("flo_01", N(flo_01)), - STAGE("flo_01b", N(flo_01b)), - STAGE("flo_01c", N(flo_01c)), - STAGE("flo_02", N(flo_02)), - STAGE("flo_02b", N(flo_02b)), - STAGE("flo_02c", N(flo_02c)), - STAGE("flo_03", N(flo_03)), - STAGE("flo_04", N(flo_04)), - STAGE("flo_05", N(flo_05)), - STAGE("flo_06", N(flo_06)), +StageList A(Stages) = { + STAGE("flo_01", A(flo_01)), + STAGE("flo_01b", A(flo_01b)), + STAGE("flo_01c", A(flo_01c)), + STAGE("flo_02", A(flo_02)), + STAGE("flo_02b", A(flo_02b)), + STAGE("flo_02c", A(flo_02c)), + STAGE("flo_03", A(flo_03)), + STAGE("flo_04", A(flo_04)), + STAGE("flo_05", A(flo_05)), + STAGE("flo_06", A(flo_06)), {}, }; diff --git a/src/battle/area/flo2/area.h b/src/battle/area/flo2/area.h new file mode 100644 index 0000000000..13d41986c7 --- /dev/null +++ b/src/battle/area/flo2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_flo2 diff --git a/src/battle/area/flo2/stage/flo_01.c b/src/battle/area/flo2/stage/flo_01.c index b9abc65b4c..c49e822802 100644 --- a/src/battle/area/flo2/stage/flo_01.c +++ b/src/battle/area/flo2/stage/flo_01.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_01 - -#include "battle/common/stage/flo_01.inc.c" +#include "battle/common/stage/area_flo/flo_01.inc.c" diff --git a/src/battle/area/flo2/stage/flo_01b.c b/src/battle/area/flo2/stage/flo_01b.c index e844564ca4..7429e06fe7 100644 --- a/src/battle/area/flo2/stage/flo_01b.c +++ b/src/battle/area/flo2/stage/flo_01b.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_01b - -#include "battle/common/stage/flo_01b.inc.c" +#include "battle/common/stage/area_flo/flo_01b.inc.c" diff --git a/src/battle/area/flo2/stage/flo_01c.c b/src/battle/area/flo2/stage/flo_01c.c index 7edbb3f34e..9de89ddfe1 100644 --- a/src/battle/area/flo2/stage/flo_01c.c +++ b/src/battle/area/flo2/stage/flo_01c.c @@ -1,8 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt01_shape.h" -#include "effects.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_01c - -#include "battle/common/stage/flo_01c.inc.c" +#include "battle/common/stage/area_flo/flo_01c.inc.c" diff --git a/src/battle/area/flo2/stage/flo_02.c b/src/battle/area/flo2/stage/flo_02.c index 6dfc8f89df..90fb03f617 100644 --- a/src/battle/area/flo2/stage/flo_02.c +++ b/src/battle/area/flo2/stage/flo_02.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_02 - -#include "battle/common/stage/flo_02.inc.c" +#include "battle/common/stage/area_flo/flo_02.inc.c" diff --git a/src/battle/area/flo2/stage/flo_02b.c b/src/battle/area/flo2/stage/flo_02b.c index 8f103b094c..5980c6a079 100644 --- a/src/battle/area/flo2/stage/flo_02b.c +++ b/src/battle/area/flo2/stage/flo_02b.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_02b - -#include "battle/common/stage/flo_02b.inc.c" +#include "battle/common/stage/area_flo/flo_02b.inc.c" diff --git a/src/battle/area/flo2/stage/flo_02c.c b/src/battle/area/flo2/stage/flo_02c.c index 6be879aa92..c2b1dc1f36 100644 --- a/src/battle/area/flo2/stage/flo_02c.c +++ b/src/battle/area/flo2/stage/flo_02c.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_02c - -#include "battle/common/stage/flo_02c.inc.c" +#include "battle/common/stage/area_flo/flo_02c.inc.c" diff --git a/src/battle/area/flo2/stage/flo_03.c b/src/battle/area/flo2/stage/flo_03.c index 2e01129d6d..94240ec958 100644 --- a/src/battle/area/flo2/stage/flo_03.c +++ b/src/battle/area/flo2/stage/flo_03.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt03_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_03 - -#include "battle/common/stage/flo_03.inc.c" +#include "battle/common/stage/area_flo/flo_03.inc.c" diff --git a/src/battle/area/flo2/stage/flo_04.c b/src/battle/area/flo2/stage/flo_04.c index 5b27566929..0157e4f01a 100644 --- a/src/battle/area/flo2/stage/flo_04.c +++ b/src/battle/area/flo2/stage/flo_04.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/flo_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_04 - -#include "battle/common/stage/flo_04.inc.c" +#include "battle/common/stage/area_flo/flo_04.inc.c" diff --git a/src/battle/area/flo2/stage/flo_05.c b/src/battle/area/flo2/stage/flo_05.c index 7ca0d8e867..a455219292 100644 --- a/src/battle/area/flo2/stage/flo_05.c +++ b/src/battle/area/flo2/stage/flo_05.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_05 - -#include "battle/common/stage/flo_05.inc.c" +#include "battle/common/stage/area_flo/flo_05.inc.c" diff --git a/src/battle/area/flo2/stage/flo_06.c b/src/battle/area/flo2/stage/flo_06.c index ad87047792..a234a2d83b 100644 --- a/src/battle/area/flo2/stage/flo_06.c +++ b/src/battle/area/flo2/stage/flo_06.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_flo2_flo_06 - -#include "battle/common/stage/flo_06.inc.c" +#include "battle/common/stage/area_flo/flo_06.inc.c" diff --git a/src/battle/area/hos/actor/ember.c b/src/battle/area/hos/actor/ember.c index e59f9d7d9e..27a5b7574b 100644 --- a/src/battle/area/hos/actor/ember.c +++ b/src/battle/area/hos/actor/ember.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_hos_ember +#include "../area.h" #include "battle/common/actor/ember.inc.c" diff --git a/src/battle/area/hos/actor/goombario_tutor.c b/src/battle/area/hos/actor/goombario_tutor.c index ff2462ec4c..1789274b5b 100644 --- a/src/battle/area/hos/actor/goombario_tutor.c +++ b/src/battle/area/hos/actor/goombario_tutor.c @@ -1,12 +1,10 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "battle/action_cmd/jump.h" #include "battle/action_cmd.h" #include "sprite/npc/BattleGoombario.h" #include "sprite/npc/Twink.h" -#define NAMESPACE b_area_hos_goombario_tutor +#define NAMESPACE A(goombario_tutor) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -140,18 +138,18 @@ EvtScript N(handleEvent_802191E0) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(48) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -190,7 +188,7 @@ EvtScript N(takeTurn_80219444) = { EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(AddGoalPos, ACTOR_SELF, -10, 0, 0) EVT_CALL(GetBattleFlags2, LVar0) - EVT_IF_FLAG(LVar0, 0x200) + EVT_IF_FLAG(LVar0, BS_FLAGS2_200) EVT_CALL(AddGoalPos, ACTOR_SELF, 5, 10, 0) EVT_END_IF EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) diff --git a/src/battle/area/hos/actor/magikoopa.c b/src/battle/area/hos/actor/magikoopa.c index 2213ce171f..9d7c9bdaf3 100644 --- a/src/battle/area/hos/actor/magikoopa.c +++ b/src/battle/area/hos/actor/magikoopa.c @@ -1,10 +1,8 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/FlyingMagikoopa.h" #include "sprite/npc/Magikoopa.h" -#define NAMESPACE b_area_hos_magikoopa +#define NAMESPACE A(magikoopa) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -473,52 +471,52 @@ EvtScript N(handleEvent_8021E6D8) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_BITWISE_OR_CONST(LVar0, 1) EVT_CALL(SetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(10) EVT_CASE_OR_EQ(61) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021E46C)) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E46C)) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E46C)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(8021E46C)) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(8021E46C)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(23) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(25) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) @@ -531,17 +529,17 @@ EvtScript N(handleEvent_8021E6D8) = { EVT_EXEC_WAIT(N(8021E46C)) EVT_END_IF EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021E46C)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) @@ -556,7 +554,7 @@ EvtScript N(handleEvent_8021E6D8) = { EVT_EXEC_WAIT(N(runAway)) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) @@ -569,16 +567,16 @@ EvtScript N(handleEvent_8021E6D8) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_MAIN, -4, 5, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN EVT_CASE_EQ(31) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(19) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021E46C)) @@ -601,27 +599,27 @@ EvtScript N(handleEvent_8021EDF0) = { EVT_BITWISE_OR_CONST(LVar0, 1) EVT_CALL(SetActorVar, ACTOR_SELF, 0, LVar0) EVT_EXEC_WAIT(N(8021D784)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(10) EVT_CASE_OR_EQ(12) EVT_EXEC_WAIT(N(8021D784)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021E46C)) EVT_EXEC_WAIT(N(8021D890)) EVT_END_CASE_GROUP EVT_CASE_EQ(61) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021E46C)) EVT_CASE_OR_EQ(14) EVT_CASE_OR_EQ(15) EVT_EXEC_WAIT(N(8021D784)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -629,35 +627,35 @@ EvtScript N(handleEvent_8021EDF0) = { EVT_EXEC_WAIT(N(8021D890)) EVT_END_CASE_GROUP EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E46C)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(8021E46C)) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(8021E46C)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(23) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(25) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) @@ -670,12 +668,12 @@ EvtScript N(handleEvent_8021EDF0) = { EVT_EXEC_WAIT(N(8021E46C)) EVT_END_IF EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021E46C)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -690,7 +688,7 @@ EvtScript N(handleEvent_8021EDF0) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_FlyingMagikoopa_Anim01) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) @@ -705,7 +703,7 @@ EvtScript N(handleEvent_8021EDF0) = { EVT_EXEC_WAIT(N(runAway)) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) @@ -718,16 +716,16 @@ EvtScript N(handleEvent_8021EDF0) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, -15, 0, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN EVT_CASE_EQ(31) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(19) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021E46C)) @@ -1370,9 +1368,9 @@ EvtScript N(makeCopy) = { EVT_SET(LFlag0, TRUE) EVT_END_IF EVT_IF_EQ(LFlag0, FALSE) - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802216C8)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802216C8)), FALSE) EVT_ELSE - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802216E4)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802216E4)), FALSE) EVT_END_IF EVT_CALL(SetActorVar, ACTOR_SELF, 9, LVar0) EVT_SET(LVarA, LVar0) diff --git a/src/battle/area/hos/area.c b/src/battle/area/hos/area.c index f1fd27a30d..9dae15aaa6 100644 --- a/src/battle/area/hos/area.c +++ b/src/battle/area/hos/area.c @@ -1,46 +1,43 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_hos +extern ActorBlueprint A(ember); +extern ActorBlueprint A(goombario_tutor); +extern ActorBlueprint A(magikoopa_flying); -extern ActorBlueprint N(goombario_tutor); -extern ActorBlueprint N(ember); -extern ActorBlueprint N(magikoopa_flying); +extern Stage A(hos_00); +extern Stage A(hos_01); +extern Stage A(hos_02); -extern Stage N(hos_00); -extern Stage N(hos_01); -extern Stage N(hos_02); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(goombario_tutor), BTL_POS_GROUND_B, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(goombario_tutor), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(ember), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(ember), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(ember), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(ember), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(ember), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(ember), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(ember), BTL_POS_GROUND_C, 8), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(ember), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(ember), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(ember), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_B, 10), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_B, 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(hos_02), "クリオ(ACヘルプ)"), - BATTLE(N(Formation_01), N(hos_01), "エルモスx2"), - BATTLE(N(Formation_02), N(hos_01), "エルモスx3"), - BATTLE(N(Formation_03), N(hos_02), "カメック(ACヘルプご)"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(hos_02), "クリオ(ACヘルプ)"), + BATTLE(A(Formation_01), A(hos_01), "エルモスx2"), + BATTLE(A(Formation_02), A(hos_01), "エルモスx3"), + BATTLE(A(Formation_03), A(hos_02), "カメック(ACヘルプご)"), {}, }; -StageList N(Stages) = { - STAGE("hos_00", N(hos_00)), - STAGE("hos_01", N(hos_01)), - STAGE("hos_02", N(hos_02)), +StageList A(Stages) = { + STAGE("hos_00", A(hos_00)), + STAGE("hos_01", A(hos_01)), + STAGE("hos_02", A(hos_02)), {}, }; diff --git a/src/battle/area/hos/area.h b/src/battle/area/hos/area.h new file mode 100644 index 0000000000..d1ae6dd5ce --- /dev/null +++ b/src/battle/area/hos/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_hos diff --git a/src/battle/area/hos/stage/hos_00.c b/src/battle/area/hos/stage/hos_00.c index dd78481b7e..f5851f1745 100644 --- a/src/battle/area/hos/stage/hos_00.c +++ b/src/battle/area/hos/stage/hos_00.c @@ -1,82 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/nok_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_hos_hos_00 - -EvtScript N(EVS_AnimateFlower) = { - EVT_SET(LVarA, LVar0) - EVT_LABEL(0) - EVT_CALL(TranslateModel, LVarA, 0, 2, 0) - EVT_WAIT(5) - EVT_CALL(TranslateModel, LVarA, 0, 0, 0) - EVT_WAIT(5) - EVT_CALL(TranslateModel, LVarA, 0, 2, 0) - EVT_WAIT(5) - EVT_CALL(TranslateModel, LVarA, 0, 0, 0) - EVT_WAIT(5) - EVT_CALL(RandInt, 30, LVar0) - EVT_ADD(LVar0, 30) - EVT_WAIT(LVar0) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_THREAD - EVT_SET(LVar0, MODEL_h1) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h3) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h4) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h5) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h6) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h7) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h9) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h10) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h11) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h12) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_hap, - MODEL_kusa3, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "nok_tex", - .shape = "nok_bt02_shape", - .hit = "nok_bt02_hit", - .bg = "nok_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_hos/hos_00.inc.c" diff --git a/src/battle/area/hos/stage/hos_01.c b/src/battle/area/hos/stage/hos_01.c index 1177229ecd..43d0d26e6f 100644 --- a/src/battle/area/hos/stage/hos_01.c +++ b/src/battle/area/hos/stage/hos_01.c @@ -1,268 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/hos_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_hos_hos_01 - -u16 N(StarPhaseAngles)[16] = {}; - -void N(build_gfx_yellow_stars)(s32 index) { - Vtx* firstVertex; - Vtx* copiedVertices; - s32 numVertices; - s32 i; - s32 temp3; - - index--; - mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices); - - for (i = 0; i < numVertices; i++) { - Vtx* vtx = &copiedVertices[i]; - s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2; - s32 temp2 = temp1 * 155; - vtx->v.cn[0] = temp2 / 0x8000 + 100; - vtx->v.cn[1] = temp2 / 0x8000 + 100; - - temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000; - vtx->v.cn[2] = vtx->v.cn[0] * temp3 / 0x10000; - } - - gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index)); - N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898); -} - -void N(build_gfx_blue_stars)(s32 index) { - Vtx* firstVertex; - Vtx* copiedVertices; - s32 numVertices; - s32 i; - s32 temp3; - - index--; - mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices); - - for (i = 0; i < numVertices; i++) { - u8* colors = copiedVertices[i].v.cn; - s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2; - colors[0] = temp1 * 155 / 0x8000 + 48.62745098039216; - colors[1] = temp1 * 155 / 0x8000 + 89.41176470588236; - - temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000; - colors[2] = colors[0] * temp3 / 0x10000 + 99.6078431372549; - } - - gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index)); - N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898); -} - -void N(build_gfx_green_stars)(s32 index) { - Vtx* firstVertex; - Vtx* copiedVertices; - s32 numVertices; - s32 i; - s32 temp3; - - index--; - mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices); - - for (i = 0; i < numVertices; i++) { - u8* colors = copiedVertices[i].v.cn; - s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2; - colors[0] = temp1 * 155 / 0x8000 + 67.45098039215686; - colors[1] = temp1 * 155 / 0x8000 + 100.0; - - temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000; - colors[2] = colors[0] * temp3 / 0x10000 + 59.21568627450981; - } - - gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index)); - N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898); -} - -void N(build_gfx_pink_stars)(s32 index) { - Vtx* firstVertex; - Vtx* copiedVertices; - s32 numVertices; - s32 i; - s32 temp3; - - index--; - mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices); - - for (i = 0; i < numVertices; i++) { - u8* colors = copiedVertices[i].v.cn; - s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2; - colors[0] = temp1 * 155 / 0x8000 + 100.0; - colors[1] = temp1 * 155 / 0x8000 + 80.3921568627451; - - temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000; - colors[2] = colors[0] * temp3 / 0x10000 + 96.07843137254902; - } - - gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index)); - N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898); -} - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o345, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o345, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o345, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o338, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o338, CUSTOM_GFX_2, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o338, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_o344, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o344, CUSTOM_GFX_3, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o344, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_3, MODEL_o354, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_4, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o354, CUSTOM_GFX_4, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o354, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_4, MODEL_o341, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_5, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o341, CUSTOM_GFX_5, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o341, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_5, MODEL_o352, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_6, EVT_PTR(N(build_gfx_blue_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o352, CUSTOM_GFX_6, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o352, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_6, MODEL_o346, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_7, EVT_PTR(N(build_gfx_blue_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o346, CUSTOM_GFX_7, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o346, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_7, MODEL_o349, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_8, EVT_PTR(N(build_gfx_green_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o349, CUSTOM_GFX_8, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o349, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_8, MODEL_o353, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_9, EVT_PTR(N(build_gfx_green_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o353, CUSTOM_GFX_9, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o353, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_CALL(MakeLocalVertexCopy, VTX_COPY_9, MODEL_o347, TRUE) - EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_A, EVT_PTR(N(build_gfx_pink_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_A, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelFlags, MODEL_o347, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) - - EVT_THREAD - EVT_CALL(SetTexPanner, MODEL_o332, TEX_PANNER_0) - EVT_CALL(SetTexPanner, MODEL_o334, TEX_PANNER_0) - EVT_CALL(SetTexPanner, MODEL_o333, TEX_PANNER_0) - EVT_CALL(SetTexPanner, MODEL_o336, TEX_PANNER_0) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(0) - EVT_ADD(LVar0, 80) - EVT_ADD(LVar1, -150) - EVT_IF_GT(LVar0, 0x8000) - EVT_ADD(LVar0, -0x8000) - EVT_END_IF - EVT_IF_LT(LVar1, -0x8000) - EVT_ADD(LVar1, 0x8000) - EVT_END_IF - EVT_ADD(LVar2, -50) - EVT_ADD(LVar3, 100) - EVT_IF_LT(LVar2, -0x8000) - EVT_ADD(LVar2, 0x8000) - EVT_END_IF - EVT_IF_GT(LVar3, 0x8000) - EVT_ADD(LVar3, -0x8000) - EVT_END_IF - EVT_CALL(SetTexPanOffset, TEX_PANNER_0, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_CALL(SetTexPanOffset, TEX_PANNER_0, TEX_PANNER_AUX, LVar2, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_LABEL(2) - EVT_CALL(MakeLerp, -7, 7, 30, EASING_COS_IN_OUT) - EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, MODEL_o357, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o344, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o361, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o354, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o341, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o362, 0, LVar0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF - EVT_CALL(MakeLerp, 7, -7, 30, EASING_COS_IN_OUT) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, MODEL_o357, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o344, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o361, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o354, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o341, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o362, 0, LVar0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_GOTO(2) - EVT_END_THREAD - EVT_THREAD - EVT_LABEL(3) - EVT_CALL(MakeLerp, 7, -7, 30, EASING_COS_IN_OUT) - EVT_LABEL(4) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, MODEL_o363, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o343, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o355, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o338, 0, LVar0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(4) - EVT_END_IF - EVT_CALL(MakeLerp, -7, 7, 30, EASING_COS_IN_OUT) - EVT_LABEL(5) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, MODEL_o363, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o343, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o355, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o338, 0, LVar0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(5) - EVT_END_IF - EVT_GOTO(3) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o345, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "hos_tex\0", - .shape = "hos_bt01_shape", - .hit = "hos_bt01_hit", - .bg = "hos_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_hos/hos_01.inc.c" diff --git a/src/battle/area/hos/stage/hos_02.c b/src/battle/area/hos/stage/hos_02.c index 830c3407b4..5ed594371a 100644 --- a/src/battle/area/hos/stage/hos_02.c +++ b/src/battle/area/hos/stage/hos_02.c @@ -1,103 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/hos_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_hos_hos_02 - -EvtScript N(EVS_PreBattle) = { - EVT_THREAD - EVT_CALL(SetTexPanner, MODEL_o372, TEX_PANNER_1) - EVT_CALL(SetTexPanner, MODEL_o375, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(0) - EVT_ADD(LVar0, -50) - EVT_ADD(LVar1, 300) - EVT_ADD(LVar2, 90) - EVT_ADD(LVar3, -200) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_AUX, LVar2, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_SET(LVarA, 0) - EVT_LABEL(2) - EVT_CALL(MakeLerp, -7, 7, 40, EASING_COS_IN_OUT) - EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, MODEL_o371, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o372, 0, LVar0, 0) - EVT_MUL(LVar0, 3) - EVT_CALL(RotateModel, 17, LVarA, 0, 0, 1) - EVT_ADD(LVarA, -3) - EVT_CALL(ClampAngleFloat, LVarA) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF - EVT_CALL(MakeLerp, 7, -7, 40, EASING_COS_IN_OUT) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, MODEL_o371, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o372, 0, LVar0, 0) - EVT_MUL(LVar0, 3) - EVT_CALL(RotateModel, 17, LVarA, 0, 0, 1) - EVT_ADD(LVarA, -3) - EVT_CALL(ClampAngleFloat, LVarA) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_GOTO(2) - EVT_END_THREAD - EVT_THREAD - EVT_SET(LVarA, 0) - EVT_LABEL(2) - EVT_CALL(MakeLerp, -10, 4, 40, EASING_COS_IN_OUT) - EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, MODEL_o376, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o375, 0, LVar0, 0) - EVT_MUL(LVar0, -3) - EVT_CALL(RotateModel, MODEL_o376, LVarA, 0, 0, 1) - EVT_ADD(LVarA, -3) - EVT_CALL(ClampAngleFloat, LVarA) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF - EVT_CALL(MakeLerp, 4, -10, 40, EASING_COS_IN_OUT) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, MODEL_o376, 0, LVar0, 0) - EVT_CALL(TranslateModel, MODEL_o375, 0, LVar0, 0) - EVT_MUL(LVar0, -3) - EVT_CALL(RotateModel, MODEL_o376, LVarA, 0, 0, 1) - EVT_ADD(LVarA, -3) - EVT_CALL(ClampAngleFloat, LVarA) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_GOTO(2) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "hos_tex", - .shape = "hos_bt02_shape", - .hit = "hos_bt02_hit", - .bg = "nok_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_hos/hos_02.inc.c" diff --git a/src/battle/area/isk_part_1/actor/buzzy_beetle.c b/src/battle/area/isk_part_1/actor/buzzy_beetle.c index ebdeb84fc2..fabefe45d4 100644 --- a/src/battle/area/isk_part_1/actor/buzzy_beetle.c +++ b/src/battle/area/isk_part_1/actor/buzzy_beetle.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_isk_part_1_buzzy_beetle +#include "../area.h" #include "battle/common/actor/buzzy_beetle.inc.c" diff --git a/src/battle/area/isk_part_1/actor/pokey_mummy.c b/src/battle/area/isk_part_1/actor/pokey_mummy.c index 2923a639ac..351b212e92 100644 --- a/src/battle/area/isk_part_1/actor/pokey_mummy.c +++ b/src/battle/area/isk_part_1/actor/pokey_mummy.c @@ -1,1014 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Pokey.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_pokey_mummy - -extern s32 N(IdleAnimations_80218DC8)[]; -extern s32 N(IdleAnimations_80218EB8)[]; -extern EvtScript N(EVS_Init); -extern EvtScript N(takeTurn_80219D88); -extern EvtScript N(idle_80219040); -extern EvtScript N(handleEvent_80219050); -extern EvtScript N(8021B998); -extern EvtScript N(8021A6C8); -extern EvtScript N(8021B088); -extern EvtScript N(8021B1B4); -extern EvtScript N(8021BDE4); -extern EvtScript N(8021C2BC); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, - PRT_5 = 5, - PRT_6 = 6, -}; - -s32 N(DefenseTable_80218C10)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_80218C1C)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 80, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 100, - STATUS_KEY_SHRINK, 90, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 20 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80218DC8), - .defenseTable = N(DefenseTable_80218C10), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 72 }, - .opacity = 255, - .idleAnimations = NULL, - .defenseTable = N(DefenseTable_80218C10), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -8 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 54 }, - .opacity = 255, - .idleAnimations = NULL, - .defenseTable = N(DefenseTable_80218C10), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -8 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_4, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 36 }, - .opacity = 255, - .idleAnimations = NULL, - .defenseTable = N(DefenseTable_80218C10), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -8 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_5, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 16 }, - .opacity = 255, - .idleAnimations = NULL, - .defenseTable = N(DefenseTable_80218C10), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -8 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_6, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 0 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80218EB8), - .defenseTable = N(DefenseTable_80218C10), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_POKEY_MUMMY, - .level = 10, - .maxHP = 4, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(EVS_Init), - .statusTable = N(StatusTable_80218C1C), - .escapeChance = 60, - .airLiftChance = 90, - .hurricaneChance = 85, - .spookChance = 60, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 95, - .coinReward = 1, - .size = { 24, 80 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -15, 75 }, - .statusTextOffset = { 10, 65 }, -}; - -s32 N(IdleAnimations_80218DC8)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Anim04, - STATUS_KEY_STONE, ANIM_Pokey_Mummy_Anim00, - STATUS_KEY_SLEEP, ANIM_Pokey_Mummy_Anim25, - STATUS_KEY_STOP, ANIM_Pokey_Mummy_Anim00, - STATUS_KEY_PARALYZE, ANIM_Pokey_Mummy_Anim00, - STATUS_KEY_DIZZY, ANIM_Pokey_Mummy_Anim21, - STATUS_KEY_FEAR, ANIM_Pokey_Mummy_Anim21, - STATUS_END, -}; - -s32 N(IdleAnimations_80218E04)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Anim05, - STATUS_KEY_STONE, ANIM_Pokey_Mummy_Anim01, - STATUS_KEY_SLEEP, ANIM_Pokey_Mummy_Anim26, - STATUS_KEY_STOP, ANIM_Pokey_Mummy_Anim01, - STATUS_KEY_PARALYZE, ANIM_Pokey_Mummy_Anim01, - STATUS_KEY_DIZZY, ANIM_Pokey_Mummy_Anim22, - STATUS_KEY_FEAR, ANIM_Pokey_Mummy_Anim22, - STATUS_END, -}; - -s32 N(IdleAnimations_80218E40)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Anim06, - STATUS_KEY_STONE, ANIM_Pokey_Mummy_Anim02, - STATUS_KEY_SLEEP, ANIM_Pokey_Mummy_Anim27, - STATUS_KEY_STOP, ANIM_Pokey_Mummy_Anim02, - STATUS_KEY_PARALYZE, ANIM_Pokey_Mummy_Anim02, - STATUS_KEY_DIZZY, ANIM_Pokey_Mummy_Anim23, - STATUS_KEY_FEAR, ANIM_Pokey_Mummy_Anim23, - STATUS_END, -}; - -s32 N(IdleAnimations_80218E7C)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Anim07, - STATUS_KEY_STONE, ANIM_Pokey_Mummy_Anim03, - STATUS_KEY_SLEEP, ANIM_Pokey_Mummy_Anim28, - STATUS_KEY_STOP, ANIM_Pokey_Mummy_Anim03, - STATUS_KEY_PARALYZE, ANIM_Pokey_Mummy_Anim03, - STATUS_KEY_DIZZY, ANIM_Pokey_Mummy_Anim24, - STATUS_KEY_FEAR, ANIM_Pokey_Mummy_Anim24, - STATUS_END, -}; - -s32 N(IdleAnimations_80218EB8)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Anim16, - STATUS_END, -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(EVS_Init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80219D88))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80219040))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80219050))) - EVT_CALL(SetActorVar, ACTOR_SELF, 10, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_CALL(SetActorVar, ACTOR_SELF, 9, LVar0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x00310104) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0x00310108) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0x0031010C) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 0x00310110) - EVT_CALL(SetActorVar, ACTOR_SELF, 5, 0x00310111) - EVT_CALL(SetActorVar, ACTOR_SELF, 6, 0x00310118) - EVT_CALL(SetActorVar, ACTOR_SELF, 7, 0x00310119) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_80219040) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80219050) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CASE_EQ(EVENT_HIT) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_EQ(LVarA, 3) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_ELSE - EVT_CALL(GetDamageSource, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) - EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) - EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) - EVT_EXEC_WAIT(N(8021BDE4)) - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_SWITCH - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(EVENT_DEATH) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_EQ(LVarA, 3) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_ELSE - EVT_CALL(GetDamageSource, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) - EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) - EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) - EVT_EXEC_WAIT(N(8021BDE4)) - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_END_SWITCH - EVT_END_IF - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_CALL(GetActorVar, ACTOR_SELF, 6, LVar1) - EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar2) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_EQ(LVarA, 3) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_ELSE - EVT_CALL(GetDamageSource, LVarA) - EVT_SWITCH(LVarA) - EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) - EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) - EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) - EVT_EXEC_WAIT(N(8021BDE4)) - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_END_SWITCH - EVT_END_IF - EVT_END_IF - EVT_CASE_OR_EQ(EVENT_BURN_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, 6, LVar1) - EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar2) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_EQ(LVarA, 3) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_ELSE - EVT_CALL(GetDamageSource, LVarA) - EVT_SWITCH(LVarA) - EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) - EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) - EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) - EVT_EXEC_WAIT(N(8021BDE4)) - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_END_SWITCH - EVT_END_IF - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_EXEC_WAIT(N(8021B088)) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_EXEC_WAIT(N(8021B088)) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_LAUNCH_HIT) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_ELSE - EVT_EXEC_WAIT(N(8021BDE4)) - EVT_END_IF - EVT_CASE_EQ(EVENT_SPIN_SMASH_LAUNCH_DEATH) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_ELSE - EVT_EXEC_WAIT(N(8021BDE4)) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, -1) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_SPIKE_TAUNT) - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) - EVT_CALL(AfflictActor, ACTOR_PLAYER, STATUS_KEY_POISON, 3) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 77) - EVT_SET_CONST(LVar2, ANIM_Pokey_Mummy_Anim21) - EVT_CASE_EQ(1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 59) - EVT_SET_CONST(LVar2, ANIM_Pokey_Mummy_Anim22) - EVT_CASE_EQ(2) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 41) - EVT_SET_CONST(LVar2, ANIM_Pokey_Mummy_Anim23) - EVT_CASE_EQ(3) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 23) - EVT_SET_CONST(LVar2, ANIM_Pokey_Mummy_Anim24) - EVT_END_SWITCH - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SLEEP) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar2) - EVT_END_IF - EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar6) - EVT_IF_FLAG(LVar6, STATUS_FLAG_SHRINK) - EVT_MULF(LVar0, EVT_FLOAT(0.4)) - EVT_MULF(LVar1, EVT_FLOAT(0.4)) - EVT_END_IF - EVT_ADDF(LVar3, LVar0) - EVT_ADDF(LVar4, LVar1) - EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar3, LVar4, LVar5, 20, 0) - EVT_WAIT(30) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_EXEC_WAIT(N(8021C2BC)) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_80219D88) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_EQ(LVarA, 3) - EVT_EXEC_WAIT(N(8021A6C8)) - EVT_RETURN - EVT_END_IF - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 1) - EVT_END_IF - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_6, ACTOR_SOUND_JUMP, 0, 0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_ELSE - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) - EVT_END_IF - EVT_CHILD_THREAD - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(2.2)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Mummy_Anim16) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_SWITCH(LVarA) - EVT_CASE_EQ(0) - EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) - EVT_ADD(LVar1, 38) - EVT_ELSE - EVT_ADD(LVar1, 15) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(1.2)) - EVT_END_IF - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 15, TRUE) - EVT_CASE_EQ(1) - EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) - EVT_ADD(LVar1, 20) - EVT_ELSE - EVT_ADD(LVar1, 8) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(1.2)) - EVT_END_IF - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 15, TRUE) - EVT_CASE_EQ(2) - EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) - EVT_ADD(LVar1, 8) - EVT_ELSE - EVT_ADD(LVar1, 3) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(1.2)) - EVT_END_IF - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 15, TRUE) - EVT_CASE_EQ(3) - EVT_END_SWITCH - EVT_END_CHILD_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_342) - EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) - EVT_WAIT(12) - EVT_CALL(GetActorVar, ACTOR_SELF, 5, LVar1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2CE) - EVT_WAIT(3) - EVT_EXEC_WAIT(N(8021B1B4)) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_IF_EQ(LVar0, HIT_RESULT_LUCKY) - EVT_CHILD_THREAD - EVT_WAIT(5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_CHILD_THREAD - EVT_END_IF - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 80) - EVT_SUB(LVar1, 5) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(20.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Mummy_Anim16) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(20.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Mummy_Anim16) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 40), 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 55) - EVT_SET(LVar1, 0) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(4.0)) - EVT_SUB(LVar0, 24) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(3.0)) - EVT_SUB(LVar0, 20) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 20, EASING_LINEAR) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021A6C8) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_2EC, SOUND_2EC) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EC, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Anim0B) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Anim07) - EVT_WAIT(4) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(4) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Anim0B) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 2, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_SET(LVar1, 10) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) - EVT_CHILD_THREAD - EVT_WAIT(2) - EVT_SET(LVar0, 0) - EVT_LOOP(5) - EVT_ADD(LVar0, 30) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_CHILD_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 22, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) - EVT_CHILD_THREAD - EVT_WAIT(2) - EVT_SET(LVar0, 180) - EVT_LOOP(6) - EVT_ADD(LVar0, 30) - EVT_IF_EQ(LVar0, 360) - EVT_SET(LVar0, 0) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_CHILD_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Anim0B) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Anim07) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) - EVT_CHILD_THREAD - EVT_WAIT(2) - EVT_SET(LVar0, 0) - EVT_LOOP(5) - EVT_ADD(LVar0, 30) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_CHILD_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 100), 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Anim07) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 10) - EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Anim07) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Anim0B) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Anim07) - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021B088) = { - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_SWITCH(LVarA) - EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(8021B998)) - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(8021B998)) - EVT_CASE_EQ(2) - EVT_EXEC_WAIT(N(8021B998)) - EVT_CASE_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(8021B1B4) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_SWITCH(LVarA) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x00310105) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0x00310109) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0x0031010D) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 0x00310112) - EVT_CALL(SetActorVar, ACTOR_SELF, 5, 0x00310113) - EVT_CALL(SetActorVar, ACTOR_SELF, 6, 0x0031011A) - EVT_CALL(SetActorVar, ACTOR_SELF, 7, 0x0031011B) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218E04))) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_NO_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_CALL(SetActorSize, ACTOR_SELF, 62, EVT_IGNORE_ARG) - EVT_CALL(SetPartSize, ACTOR_SELF, PRT_MAIN, 62, EVT_IGNORE_ARG) - EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 55, 10, 45) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x00310106) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0x0031010A) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0x0031010E) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 0x00310114) - EVT_CALL(SetActorVar, ACTOR_SELF, 5, 0x00310115) - EVT_CALL(SetActorVar, ACTOR_SELF, 6, 0x0031011C) - EVT_CALL(SetActorVar, ACTOR_SELF, 7, 0x0031011D) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218E40))) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_NO_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 2) - EVT_CALL(SetActorSize, ACTOR_SELF, 44, EVT_IGNORE_ARG) - EVT_CALL(SetPartSize, ACTOR_SELF, PRT_MAIN, 44, EVT_IGNORE_ARG) - EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 35, 10, 25) - EVT_CASE_EQ(2) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x00310107) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0x0031010B) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0x0031010F) - EVT_CALL(SetActorVar, ACTOR_SELF, 6, 0x0031011E) - EVT_CALL(SetActorVar, ACTOR_SELF, 7, 0x0031011F) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218E7C))) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_NO_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 3) - EVT_CALL(SetActorSize, ACTOR_SELF, 26, EVT_IGNORE_ARG) - EVT_CALL(SetPartSize, ACTOR_SELF, PRT_MAIN, 26, EVT_IGNORE_ARG) - EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 15, 10, 5) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(8021B6AC) = { - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 18) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar3, LVar1) - EVT_WAIT(2) - EVT_SUB(LVar3, 1) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(3) - EVT_SUB(LVar3, 2) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(2) - EVT_SUB(LVar3, 3) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(1) - EVT_SUB(LVar3, 5) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(1) - EVT_SUB(LVar3, 7) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(1) - EVT_ADD(LVar3, 2) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(1) - EVT_ADD(LVar3, 3) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(1) - EVT_ADD(LVar3, 3) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(1) - EVT_SUB(LVar3, 3) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(1) - EVT_SUB(LVar3, 3) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_WAIT(1) - EVT_SUB(LVar3, 2) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021B998) = { - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_ELSE - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) - EVT_END_IF - EVT_EXEC_WAIT(N(8021B1B4)) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) - EVT_CHILD_THREAD - EVT_WAIT(4) - EVT_EXEC_WAIT(N(8021B6AC)) - EVT_END_CHILD_THREAD - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_4 | TARGET_FLAG_8000 | TARGET_FLAG_10000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerID, LVar1) - EVT_CALL(GetOwnerTarget, LVar0, LVar9) - EVT_IF_NE(LVar1, LVar0) - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_GOTO(0) - EVT_END_IF - EVT_LABEL(1) - EVT_ADD(LVarF, 1) - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_EQ(LVar0, -1) - EVT_GOTO(10) - EVT_END_IF - EVT_CALL(GetOwnerTarget, LVar0, LVar9) - EVT_CALL(GetActorFlags, LVar0, LVar1) - EVT_IF_FLAG(LVar1, ACTOR_FLAG_TARGET_ONLY) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetOwnerID, LVar0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(7.0)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) - EVT_CHILD_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 2, EVT_FLOAT(1.0)) - EVT_END_CHILD_THREAD - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(DispatchDamageEvent, LVar0, 1, EVENT_SPIN_SMASH_LAUNCH_HIT) - EVT_GOTO(1) - EVT_LABEL(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_03) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, 296, 0, 0, 0, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021BDE4) = { - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_ELSE - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) - EVT_END_IF - EVT_EXEC_WAIT(N(8021B1B4)) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar1) - EVT_SWITCH(LVar1) - EVT_CASE_OR_EQ(EVENT_BURN_HIT) - EVT_CASE_OR_EQ(EVENT_BURN_DEATH) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Anim20) - EVT_CALL(GetActorVar, ACTOR_SELF, 6, LVar1) - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) - EVT_CHILD_THREAD - EVT_WAIT(4) - EVT_EXEC_WAIT(N(8021B6AC)) - EVT_END_CHILD_THREAD - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_NE(LVarA, 3) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 10, 18, EASING_LINEAR) - EVT_ADD(LVar0, 20) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 8, 10, EASING_LINEAR) - EVT_LOOP(20) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_ELSE - EVT_WAIT(30) - EVT_END_IF - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) - EVT_DIV(LVar3, 2) - EVT_ADD(LVar1, LVar3) - EVT_ADD(LVar2, 5) - EVT_DIVF(LVar3, EVT_FLOAT(10.0)) - EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar0, LVar1, LVar2, LVar3, 10, 0) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) - EVT_WAIT(10) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(8021C2BC) = { - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetActorFlags, ACTOR_SELF, LVar9) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.05)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVarA, LVarB, LVarC) - EVT_SET(LVarD, LVarB) - EVT_ADD(LVarD, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVarA, LVarD, LVarC) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) - EVT_WAIT(20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVarA, LVarB, LVarC) - EVT_CALL(FallToGoal, ACTOR_SELF, 10) - EVT_WAIT(20) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_WAIT(5) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, 200, 0, 0) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_WAIT(8) - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(RemoveActor, ACTOR_SELF) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/pokey_mummy.inc.c" diff --git a/src/battle/area/isk_part_1/actor/stone_chomp.c b/src/battle/area/isk_part_1/actor/stone_chomp.c index 261198f012..5ea469e316 100644 --- a/src/battle/area/isk_part_1/actor/stone_chomp.c +++ b/src/battle/area/isk_part_1/actor/stone_chomp.c @@ -1,770 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/StoneChomp.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_stone_chomp - -extern EvtScript N(EVS_Init); -extern EvtScript N(EVS_TakeTurn); -extern EvtScript N(EVS_Idle); -extern EvtScript N(EVS_HandleEvent); -extern EvtScript N(EVS_Chomp_HopToPos); -extern EvtScript N(EVS_UpdateChain); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_TARGET = 2, - PRT_CHAIN_1 = 3, - PRT_CHAIN_2 = 4, - PRT_CHAIN_3 = 5, - PRT_CHAIN_4 = 6, - PRT_CHAIN_5 = 7, - PRT_CHAIN_6 = 8, - PRT_CHAIN_7 = 9, - PRT_CHAIN_8 = 10, -}; - -enum N(ActorVars) { - AVAR_EnableChainSounds = 8, -}; - -enum N(ActorParams) { - DMG_CHOMP_BITE = 3, -}; - -s32 N(BasicAnims)[] = { - STATUS_KEY_NORMAL, ANIM_StoneChomp_Idle, - STATUS_KEY_STONE, ANIM_StoneChomp_Still, - STATUS_KEY_SLEEP, ANIM_StoneChomp_Sleep, - STATUS_KEY_POISON, ANIM_StoneChomp_Idle, - STATUS_KEY_STOP, ANIM_StoneChomp_Still, - STATUS_KEY_STATIC, ANIM_StoneChomp_Idle, - STATUS_KEY_DIZZY, ANIM_StoneChomp_Dizzy, - STATUS_END, -}; - -s32 N(QuickBiteAnims)[] = { - STATUS_KEY_NORMAL, ANIM_StoneChomp_QuickBite, - STATUS_KEY_POISON, ANIM_StoneChomp_QuickBite, - STATUS_KEY_STOP, ANIM_StoneChomp_Still, - STATUS_KEY_STONE, ANIM_StoneChomp_Still, - STATUS_KEY_SLEEP, ANIM_StoneChomp_Sleep, - STATUS_KEY_STATIC, ANIM_StoneChomp_QuickBite, - STATUS_KEY_DIZZY, ANIM_StoneChomp_Dizzy, - STATUS_END, -}; - -s32 N(BiteAnims)[] = { - STATUS_KEY_NORMAL, ANIM_StoneChomp_Bite, - STATUS_KEY_POISON, ANIM_StoneChomp_Bite, - STATUS_KEY_STOP, ANIM_StoneChomp_Still, - STATUS_KEY_STONE, ANIM_StoneChomp_Still, - STATUS_KEY_SLEEP, ANIM_StoneChomp_Sleep, - STATUS_KEY_STATIC, ANIM_StoneChomp_Bite, - STATUS_KEY_DIZZY, ANIM_StoneChomp_Dizzy, - STATUS_END, -}; - -s32 N(SlowBiteAnims)[] = { - STATUS_KEY_NORMAL, ANIM_StoneChomp_SlowBite, - STATUS_KEY_POISON, ANIM_StoneChomp_SlowBite, - STATUS_KEY_STOP, ANIM_StoneChomp_Still, - STATUS_KEY_STONE, ANIM_StoneChomp_Still, - STATUS_KEY_SLEEP, ANIM_StoneChomp_Sleep, - STATUS_KEY_STATIC, ANIM_StoneChomp_SlowBite, - STATUS_KEY_DIZZY, ANIM_StoneChomp_Dizzy, - STATUS_END, -}; - -s32 N(ChainAnims)[] = { - STATUS_KEY_NORMAL, ANIM_StoneChomp_Chain, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 1, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 0, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 75, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 50, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 75, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, -1, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(BasicAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION | ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_TARGET, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -13, 40 }, - .opacity = 255, - .idleAnimations = N(BasicAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -14 }, - }, - { - .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_CHAIN_1, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 12 }, - .opacity = 255, - .idleAnimations = N(ChainAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_CHAIN_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 12 }, - .opacity = 255, - .idleAnimations = N(ChainAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_CHAIN_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 12 }, - .opacity = 255, - .idleAnimations = N(ChainAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_CHAIN_4, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 12 }, - .opacity = 255, - .idleAnimations = N(ChainAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_CHAIN_5, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 12 }, - .opacity = 255, - .idleAnimations = N(ChainAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_CHAIN_6, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 12 }, - .opacity = 255, - .idleAnimations = N(ChainAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_CHAIN_7, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 12 }, - .opacity = 255, - .idleAnimations = N(ChainAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_CHAIN_8, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 12 }, - .opacity = 255, - .idleAnimations = N(ChainAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_STONE_CHOMP, - .level = 14, - .maxHP = 4, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(EVS_Init), - .statusTable = N(StatusTable), - .escapeChance = 0, - .airLiftChance = 25, - .hurricaneChance = 25, - .spookChance = 0, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 85, - .coinReward = 5, - .size = { 56, 40 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -#define CHOMP_CHAIN_FIRST_PART_IDX PRT_CHAIN_1 -#define CHOMP_CHAIN_LAST_PART_IDX PRT_CHAIN_8 -#define CHOMP_CHAIN_AVAR_SOUNDS AVAR_EnableChainSounds -#include "common/battle/ChompChainSupport.inc.c" - -// Custom version of EVS_Enemy_HopHome -// (in) LVar0: part idx -// (in) LVar1: hopping animID -EvtScript N(EVS_Chomp_HopHome) = { - EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_EXEC_WAIT(N(EVS_Chomp_HopToPos)) - EVT_RETURN - EVT_END -}; - -// Custom version of EVS_Enemy_HopToPos -// (in) LVar0: target posX -// (in) LVar1: target posY -// (in) LVar2: target posZ -EvtScript N(EVS_Chomp_HopToPos) = { - EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_LABEL(0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_IF_EQ(LVar3, LVar0) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_LT(LVar3, LVar0) - EVT_SET(LVar4, LVar0) - EVT_SUB(LVar4, LVar3) - EVT_IF_LT(LVar4, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_ELSE - EVT_SET(LVar4, LVar3) - EVT_ADD(LVar3, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar3, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_END_IF - EVT_ELSE - EVT_SET(LVar4, LVar3) - EVT_SUB(LVar4, LVar0) - EVT_IF_LT(LVar4, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_ELSE - EVT_SUB(LVar3, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar3, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_END_IF - EVT_END_IF - EVT_GOTO(0) - EVT_LABEL(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Init) = { - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) - EVT_SET(LVar0, PRT_CHAIN_1) - EVT_LOOP(1 + (PRT_CHAIN_8 - PRT_CHAIN_1)) - EVT_CALL(SetPartSize, ACTOR_SELF, LVar0, 16, 16) - EVT_ADD(LVar0, 1) - EVT_END_LOOP - EVT_CALL(N(ChompChainInit)) - EVT_EXEC(N(EVS_UpdateChain)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_UpdateTargetPartPos) = { - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_TARGET, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_TARGET, 0, 0) - EVT_ELSE - EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) - EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_TARGET, -13, 40) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_TARGET, 0, -14) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Idle) = { - EVT_LABEL(0) - EVT_LOOP(0) - EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(SlowBiteAnims))) - EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) - EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 11, 1) - EVT_LOOP(0) - EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) - EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 6, 1) - EVT_CALL(RandInt, 10, LVar0) - EVT_ADD(LVar0, 1) - EVT_WAIT(LVar0) - EVT_LOOP(0) - EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(BiteAnims))) - EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) - EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 15, 1) - EVT_LOOP(0) - EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(SlowBiteAnims))) - EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) - EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 12, 1) - EVT_LOOP(0) - EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) - EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 9, 1) - EVT_LOOP(0) - EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(QuickBiteAnims))) - EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) - EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 6, 1) - EVT_CALL(RandInt, 10, LVar0) - EVT_ADD(LVar0, 10) - EVT_WAIT(LVar0) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_UpdateChain) = { - EVT_LABEL(0) - EVT_WAIT(1) - EVT_CALL(N(ChompChainUpdate)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_HandleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_1, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_2, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_3, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_4, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_5, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_6, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_7, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_8, ANIM_StoneChomp_BurnChain) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_StoneChomp_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_1, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_2, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_3, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_4, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_5, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_6, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_7, ANIM_StoneChomp_BurnChain) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_8, ANIM_StoneChomp_BurnChain) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_StoneChomp_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) - EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_CALL(AddGoalPos, ACTOR_SELF, 15, 0, 0) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_CALL(AddGoalPos, ACTOR_SELF, 5, 0, 0) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_SlowBite) - EVT_EXEC_WAIT(N(EVS_Chomp_HopHome)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) - EVT_END_THREAD - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Idle) - EVT_SET_CONST(LVar2, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_SUB(LVar1, 10) - EVT_ADD(LVar2, 4) - EVT_ELSE - EVT_SUB(LVar1, 5) - EVT_ADD(LVar2, 11) - EVT_END_IF - EVT_CALL(SetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_StoneChomp_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CASE_EQ(EVENT_UP_AND_AWAY) - EVT_WAIT(1000) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP | STATUS_FLAG_PARALYZE | STATUS_FLAG_DIZZY | STATUS_FLAG_STONE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_IF_NE(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, 0, LVar2) - EVT_CALL(FallToGoal, ACTOR_SELF, 11) - EVT_END_IF - EVT_END_IF - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_TakeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, TRUE) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_ADD(LVar0, 45) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_SlowBite) - EVT_WAIT(15) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_10F) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 25) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_SUB(LVar0, 15) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Bite) - EVT_WAIT(20) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Bite) - EVT_EXEC_WAIT(N(EVS_Chomp_HopToPos)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, 4) - EVT_ELSE - EVT_ADD(LVar0, 10) - EVT_END_IF - EVT_SET(LVar1, 27) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.2)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_CHOMP_BITE, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Bite) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_SUB(LVar0, 10) - EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) - EVT_WAIT(8) - EVT_CALL(YieldTurn) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Bite) - EVT_EXEC_WAIT(N(EVS_Chomp_HopToPos)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/stone_chomp.inc.c" diff --git a/src/battle/area/isk_part_1/actor/swooper.c b/src/battle/area/isk_part_1/actor/swooper.c index 2646b892a4..81a24f3134 100644 --- a/src/battle/area/isk_part_1/actor/swooper.c +++ b/src/battle/area/isk_part_1/actor/swooper.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_isk_part_1_swooper +#include "../area.h" #include "battle/common/actor/swooper.inc.c" diff --git a/src/battle/area/isk_part_1/area.c b/src/battle/area/isk_part_1/area.c index 07497d243c..72f1c06595 100644 --- a/src/battle/area/isk_part_1/area.c +++ b/src/battle/area/isk_part_1/area.c @@ -1,199 +1,196 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_isk_part_1 +extern ActorBlueprint A(pokey_mummy); +extern ActorBlueprint A(swooper); +extern ActorBlueprint A(stone_chomp); +extern ActorBlueprint A(buzzy_beetle); -extern ActorBlueprint N(pokey_mummy); -extern ActorBlueprint N(swooper); -extern ActorBlueprint N(stone_chomp); -extern ActorBlueprint N(buzzy_beetle); +extern Stage A(isk_00); +extern Stage A(isk_01); +extern Stage A(isk_02); +extern Stage A(isk_02b); +extern Stage A(isk_02c); +extern Stage A(isk_03); +extern Stage A(isk_03b); +extern Stage A(isk_04); +extern Stage A(isk_05); +extern Stage A(isk_06); +extern Stage A(isk_06b); +extern Stage A(isk_07); +extern Stage A(isk_08); -extern Stage N(isk_00); -extern Stage N(isk_01); -extern Stage N(isk_02); -extern Stage N(isk_02b); -extern Stage N(isk_02c); -extern Stage N(isk_03); -extern Stage N(isk_03b); -extern Stage N(isk_04); -extern Stage N(isk_05); -extern Stage N(isk_06); -extern Stage N(isk_06b); -extern Stage N(isk_07); -extern Stage N(isk_08); +Vec3i A(vector3D_80224070) = { 15, 133, -25 }; +Vec3i A(vector3D_8022407C) = { 55, 133, -25 }; +Vec3i A(vector3D_80224088) = { 95, 133, -25 }; +Vec3i A(vector3D_80224094) = { 135, 133, -25 }; -Vec3i N(vector3D_80224070) = { 15, 133, -25 }; -Vec3i N(vector3D_8022407C) = { 55, 133, -25 }; -Vec3i N(vector3D_80224088) = { 95, 133, -25 }; -Vec3i N(vector3D_80224094) = { 135, 133, -25 }; +Vec3i A(vector3D_802240A0) = { 15, 112, -25 }; +Vec3i A(vector3D_802240AC) = { 55, 112, -25 }; +Vec3i A(vector3D_802240B8) = { 95, 112, -25 }; +Vec3i A(vector3D_802240C4) = { 135, 112, -25 }; -Vec3i N(vector3D_802240A0) = { 15, 112, -25 }; -Vec3i N(vector3D_802240AC) = { 55, 112, -25 }; -Vec3i N(vector3D_802240B8) = { 95, 112, -25 }; -Vec3i N(vector3D_802240C4) = { 135, 112, -25 }; - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_C, 8), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_B, 9), - ACTOR_BY_POS(N(swooper), N(vector3D_80224088), 8), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_B, 9), + ACTOR_BY_POS(A(swooper), A(vector3D_80224088), 8), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_B, 9), - ACTOR_BY_POS(N(swooper), N(vector3D_80224088), 8), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_B, 9), + ACTOR_BY_POS(A(swooper), A(vector3D_80224088), 8), }; -Vec3i N(vector3D_802241E8) = { 80, 133, -25 }; -Vec3i N(vector3D_802241F4) = { 115, 133, -25 }; +Vec3i A(vector3D_802241E8) = { 80, 133, -25 }; +Vec3i A(vector3D_802241F4) = { 115, 133, -25 }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pokey_mummy), BTL_POS_GROUND_B, 9), - ACTOR_BY_POS(N(swooper), N(vector3D_802241E8), 8), - ACTOR_BY_POS(N(swooper), N(vector3D_802241F4), 7), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pokey_mummy), BTL_POS_GROUND_B, 9), + ACTOR_BY_POS(A(swooper), A(vector3D_802241E8), 8), + ACTOR_BY_POS(A(swooper), A(vector3D_802241F4), 7), }; -Formation N(Formation_05) = { - ACTOR_BY_POS(N(swooper), N(vector3D_8022407C), 10), - ACTOR_BY_POS(N(swooper), N(vector3D_80224088), 9), +Formation A(Formation_05) = { + ACTOR_BY_POS(A(swooper), A(vector3D_8022407C), 10), + ACTOR_BY_POS(A(swooper), A(vector3D_80224088), 9), }; -Formation N(Formation_06) = { - ACTOR_BY_POS(N(swooper), N(vector3D_80224070), 10), - ACTOR_BY_POS(N(swooper), N(vector3D_8022407C), 9), - ACTOR_BY_POS(N(swooper), N(vector3D_80224088), 8), +Formation A(Formation_06) = { + ACTOR_BY_POS(A(swooper), A(vector3D_80224070), 10), + ACTOR_BY_POS(A(swooper), A(vector3D_8022407C), 9), + ACTOR_BY_POS(A(swooper), A(vector3D_80224088), 8), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(stone_chomp), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(stone_chomp), BTL_POS_GROUND_C, 9), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(stone_chomp), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(stone_chomp), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(stone_chomp), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(stone_chomp), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(stone_chomp), BTL_POS_GROUND_C, 8), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(stone_chomp), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(stone_chomp), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(stone_chomp), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_C, 9), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_D, 7), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_A, 10), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240AC), 9, 1), - ACTOR_BY_POS(N(swooper), N(vector3D_802240B8), 8), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_A, 10), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240AC), 9, 1), + ACTOR_BY_POS(A(swooper), A(vector3D_802240B8), 8), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_B, 10), - ACTOR_BY_POS(N(swooper), N(vector3D_802240B8), 9), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_B, 10), + ACTOR_BY_POS(A(swooper), A(vector3D_802240B8), 9), }; -Formation N(Formation_0D) = { - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240AC), 10, 1), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_C, 9), +Formation A(Formation_0D) = { + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240AC), 10, 1), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_B, 10), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240B8), 9, 1), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_B, 10), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240B8), 9, 1), }; -Formation N(Formation_0F) = { - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240AC), 10, 1), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240B8), 9, 1), +Formation A(Formation_0F) = { + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240AC), 10, 1), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240B8), 9, 1), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_A, 10), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240AC), 9, 1), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240B8), 8, 1), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_A, 10), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240AC), 9, 1), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240B8), 8, 1), }; -Formation N(Formation_11) = { - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240A0), 10, 1), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240AC), 9, 1), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240B8), 8, 1), +Formation A(Formation_11) = { + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240A0), 10, 1), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240AC), 9, 1), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240B8), 8, 1), }; -Vec3i N(vector3D_8022460C) = { 0, 112, -25 }; +Vec3i A(vector3D_8022460C) = { 0, 112, -25 }; -Vec3i N(vector3D_80224618) = { 40, 112, -25 }; +Vec3i A(vector3D_80224618) = { 40, 112, -25 }; -Vec3i N(vector3D_80224624) = { 80, 112, -25 }; +Vec3i A(vector3D_80224624) = { 80, 112, -25 }; -Vec3i N(vector3D_80224630) = { 120, 112, -25 }; +Vec3i A(vector3D_80224630) = { 120, 112, -25 }; -Formation N(Formation_12) = { - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_8022460C), 10, 1), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_80224618), 9, 1), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_80224624), 8, 1), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_80224630), 7, 1), +Formation A(Formation_12) = { + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_8022460C), 10, 1), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_80224618), 9, 1), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_80224624), 8, 1), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_80224630), 7, 1), }; -Formation N(Formation_13) = { - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240A0), 10, 1), - ACTOR_BY_POS(N(buzzy_beetle), N(vector3D_802240AC), 9, 1), - ACTOR_BY_POS(N(swooper), N(vector3D_802240B8), 8), +Formation A(Formation_13) = { + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240A0), 10, 1), + ACTOR_BY_POS(A(buzzy_beetle), A(vector3D_802240AC), 9, 1), + ACTOR_BY_POS(A(swooper), A(vector3D_802240B8), 8), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(isk_02b), "サンボマミーx2"), - BATTLE(N(Formation_01), N(isk_02b), "サンボマミーx3"), - BATTLE(N(Formation_02), N(isk_04), "サンボマミー,バサバサ"), - BATTLE(N(Formation_03), N(isk_04), "サンボマミーx2,バサバサ"), - BATTLE(N(Formation_04), N(isk_04), "サンボマミーx2,バサバサx2"), - BATTLE(N(Formation_05), N(isk_04), "バサバサx2"), - BATTLE(N(Formation_06), N(isk_04), "バサバサx3"), - BATTLE(N(Formation_07), N(isk_02b), "ストーンワンワンx2"), - BATTLE(N(Formation_08), N(isk_02b), "ストーンワンワンx3"), - BATTLE(N(Formation_09), N(isk_02b), "メットx2"), - BATTLE(N(Formation_0A), N(isk_02b), "メットx4"), - BATTLE(N(Formation_0B), N(isk_05), "メット,メット(てんじょう),バサバサ"), - BATTLE(N(Formation_0C), N(isk_05), "メット,バサバサ"), - BATTLE(N(Formation_0D), N(isk_05), "メット(てんじょう),メット"), - BATTLE(N(Formation_0E), N(isk_05), "メット,メット(てんじょう)"), - BATTLE(N(Formation_0F), N(isk_05), "メット(てんじょう)x2"), - BATTLE(N(Formation_10), N(isk_05), "メット,メット(てんじょう)x2"), - BATTLE(N(Formation_11), N(isk_05), "メット(てんじょう)x3"), - BATTLE(N(Formation_12), N(isk_05), "メット(てんじょう)x4"), - BATTLE(N(Formation_13), N(isk_05), "メット(てんじょう)x2,バサバサ"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(isk_02b), "サンボマミーx2"), + BATTLE(A(Formation_01), A(isk_02b), "サンボマミーx3"), + BATTLE(A(Formation_02), A(isk_04), "サンボマミー,バサバサ"), + BATTLE(A(Formation_03), A(isk_04), "サンボマミーx2,バサバサ"), + BATTLE(A(Formation_04), A(isk_04), "サンボマミーx2,バサバサx2"), + BATTLE(A(Formation_05), A(isk_04), "バサバサx2"), + BATTLE(A(Formation_06), A(isk_04), "バサバサx3"), + BATTLE(A(Formation_07), A(isk_02b), "ストーンワンワンx2"), + BATTLE(A(Formation_08), A(isk_02b), "ストーンワンワンx3"), + BATTLE(A(Formation_09), A(isk_02b), "メットx2"), + BATTLE(A(Formation_0A), A(isk_02b), "メットx4"), + BATTLE(A(Formation_0B), A(isk_05), "メット,メット(てんじょう),バサバサ"), + BATTLE(A(Formation_0C), A(isk_05), "メット,バサバサ"), + BATTLE(A(Formation_0D), A(isk_05), "メット(てんじょう),メット"), + BATTLE(A(Formation_0E), A(isk_05), "メット,メット(てんじょう)"), + BATTLE(A(Formation_0F), A(isk_05), "メット(てんじょう)x2"), + BATTLE(A(Formation_10), A(isk_05), "メット,メット(てんじょう)x2"), + BATTLE(A(Formation_11), A(isk_05), "メット(てんじょう)x3"), + BATTLE(A(Formation_12), A(isk_05), "メット(てんじょう)x4"), + BATTLE(A(Formation_13), A(isk_05), "メット(てんじょう)x2,バサバサ"), {}, }; -StageList N(Stages) = { - STAGE("isk_00", N(isk_00)), - STAGE("isk_01", N(isk_01)), - STAGE("isk_02", N(isk_02)), - STAGE("isk_02b", N(isk_02b)), - STAGE("isk_02c", N(isk_02c)), - STAGE("isk_03", N(isk_03)), - STAGE("isk_03b", N(isk_03b)), - STAGE("isk_04", N(isk_04)), - STAGE("isk_05", N(isk_05)), - STAGE("isk_06", N(isk_06)), - STAGE("isk_06b", N(isk_06b)), - STAGE("isk_07", N(isk_07)), - STAGE("isk_08", N(isk_08)), +StageList A(Stages) = { + STAGE("isk_00", A(isk_00)), + STAGE("isk_01", A(isk_01)), + STAGE("isk_02", A(isk_02)), + STAGE("isk_02b", A(isk_02b)), + STAGE("isk_02c", A(isk_02c)), + STAGE("isk_03", A(isk_03)), + STAGE("isk_03b", A(isk_03b)), + STAGE("isk_04", A(isk_04)), + STAGE("isk_05", A(isk_05)), + STAGE("isk_06", A(isk_06)), + STAGE("isk_06b", A(isk_06b)), + STAGE("isk_07", A(isk_07)), + STAGE("isk_08", A(isk_08)), {}, }; diff --git a/src/battle/area/isk_part_1/area.h b/src/battle/area/isk_part_1/area.h new file mode 100644 index 0000000000..dc57c21b0f --- /dev/null +++ b/src/battle/area/isk_part_1/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_isk_part_1 diff --git a/src/battle/area/isk_part_1/stage/isk_00.c b/src/battle/area/isk_part_1/stage/isk_00.c index d290debff9..511a491dbc 100644 --- a/src/battle/area/isk_part_1/stage/isk_00.c +++ b/src/battle/area/isk_part_1/stage/isk_00.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_00 - -#include "battle/common/stage/isk_00.inc.c" +#include "battle/common/stage/area_isk/isk_00.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_01.c b/src/battle/area/isk_part_1/stage/isk_01.c index aff8dc5dea..6565b53327 100644 --- a/src/battle/area/isk_part_1/stage/isk_01.c +++ b/src/battle/area/isk_part_1/stage/isk_01.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_01 - -#include "battle/common/stage/isk_01.inc.c" +#include "battle/common/stage/area_isk/isk_01.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_02.c b/src/battle/area/isk_part_1/stage/isk_02.c index 61da2d5f6a..0a1808cc01 100644 --- a/src/battle/area/isk_part_1/stage/isk_02.c +++ b/src/battle/area/isk_part_1/stage/isk_02.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_02 - -#include "battle/common/stage/isk_02.inc.c" +#include "battle/common/stage/area_isk/isk_02.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_02b.c b/src/battle/area/isk_part_1/stage/isk_02b.c index cf060dcb7e..6de14d4933 100644 --- a/src/battle/area/isk_part_1/stage/isk_02b.c +++ b/src/battle/area/isk_part_1/stage/isk_02b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_02b - -#include "battle/common/stage/isk_02b.inc.c" +#include "battle/common/stage/area_isk/isk_02b.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_02c.c b/src/battle/area/isk_part_1/stage/isk_02c.c index 3b486abdb4..c34fd0ff49 100644 --- a/src/battle/area/isk_part_1/stage/isk_02c.c +++ b/src/battle/area/isk_part_1/stage/isk_02c.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_02c - -#include "battle/common/stage/isk_02c.inc.c" +#include "battle/common/stage/area_isk/isk_02c.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_03.c b/src/battle/area/isk_part_1/stage/isk_03.c index 5bd9e9ec93..6f9e1ca0a3 100644 --- a/src/battle/area/isk_part_1/stage/isk_03.c +++ b/src/battle/area/isk_part_1/stage/isk_03.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_03 - -#include "battle/common/stage/isk_03.inc.c" +#include "battle/common/stage/area_isk/isk_03.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_03b.c b/src/battle/area/isk_part_1/stage/isk_03b.c index 03f79f2017..f30723af88 100644 --- a/src/battle/area/isk_part_1/stage/isk_03b.c +++ b/src/battle/area/isk_part_1/stage/isk_03b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_03b - -#include "battle/common/stage/isk_03b.inc.c" +#include "battle/common/stage/area_isk/isk_03b.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_04.c b/src/battle/area/isk_part_1/stage/isk_04.c index 2682f03995..a6399c4643 100644 --- a/src/battle/area/isk_part_1/stage/isk_04.c +++ b/src/battle/area/isk_part_1/stage/isk_04.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_04 - -#include "battle/common/stage/isk_04.inc.c" +#include "battle/common/stage/area_isk/isk_04.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_05.c b/src/battle/area/isk_part_1/stage/isk_05.c index ce4dbb5002..6ee206c608 100644 --- a/src/battle/area/isk_part_1/stage/isk_05.c +++ b/src/battle/area/isk_part_1/stage/isk_05.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_05 - -#include "battle/common/stage/isk_05.inc.c" +#include "battle/common/stage/area_isk/isk_05.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_06.c b/src/battle/area/isk_part_1/stage/isk_06.c index 13900c0b27..f9059ee50d 100644 --- a/src/battle/area/isk_part_1/stage/isk_06.c +++ b/src/battle/area/isk_part_1/stage/isk_06.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_06 - -#include "battle/common/stage/isk_06.inc.c" +#include "battle/common/stage/area_isk/isk_06.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_06b.c b/src/battle/area/isk_part_1/stage/isk_06b.c index ea33100627..48e42e9737 100644 --- a/src/battle/area/isk_part_1/stage/isk_06b.c +++ b/src/battle/area/isk_part_1/stage/isk_06b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_06b - -#include "battle/common/stage/isk_06b.inc.c" +#include "battle/common/stage/area_isk/isk_06b.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_07.c b/src/battle/area/isk_part_1/stage/isk_07.c index 0c6b93cded..671349f7c5 100644 --- a/src/battle/area/isk_part_1/stage/isk_07.c +++ b/src/battle/area/isk_part_1/stage/isk_07.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_07 - -#include "battle/common/stage/isk_07.inc.c" +#include "battle/common/stage/area_isk/isk_07.inc.c" diff --git a/src/battle/area/isk_part_1/stage/isk_08.c b/src/battle/area/isk_part_1/stage/isk_08.c index b97582d1e3..5b74b4f661 100644 --- a/src/battle/area/isk_part_1/stage/isk_08.c +++ b/src/battle/area/isk_part_1/stage/isk_08.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_1_isk_08 - -#include "battle/common/stage/isk_08.inc.c" +#include "battle/common/stage/area_isk/isk_08.inc.c" diff --git a/src/battle/area/isk_part_2/actor/chain_chomp.c b/src/battle/area/isk_part_2/actor/chain_chomp.c index 52be0de940..eaa6024a66 100644 --- a/src/battle/area/isk_part_2/actor/chain_chomp.c +++ b/src/battle/area/isk_part_2/actor/chain_chomp.c @@ -1,10 +1,8 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/ChainChomp.h" #include "sprite/npc/Tutankoopa.h" -#define NAMESPACE b_area_isk_part_2_chain_chomp +#define NAMESPACE A(chain_chomp) extern EvtScript N(EVS_Init); extern EvtScript N(EVS_TakeTurn); @@ -671,7 +669,7 @@ EvtScript N(EVS_Chomp_SpinSmashHit) = { EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) EVT_WAIT(15) EVT_LABEL(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ChainChomp_Idle) EVT_EXEC_WAIT(N(EVS_Chomp_HopHome)) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Tutankoopa_Idle) @@ -755,7 +753,7 @@ EvtScript N(EVS_TakeTurn) = { EVT_CALL(MoveBattleCamOver, 20) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ChainChomp_Idle) EVT_EXEC_WAIT(N(EVS_Chomp_HopHome)) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ChainChomp_Idle) @@ -840,7 +838,7 @@ EvtScript N(EVS_TakeTurn) = { EVT_RETURN EVT_END_IF EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ChainChomp_Idle) EVT_EXEC_WAIT(N(EVS_Chomp_HopHome)) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ChainChomp_Idle) diff --git a/src/battle/area/isk_part_2/actor/tutankoopa.c b/src/battle/area/isk_part_2/actor/tutankoopa.c index 9449bd8ae4..90d4b2ab9f 100644 --- a/src/battle/area/isk_part_2/actor/tutankoopa.c +++ b/src/battle/area/isk_part_2/actor/tutankoopa.c @@ -1,14 +1,11 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/Tutankoopa.h" #include "sprite/npc/ChainChomp.h" #include "sprite/npc/BuzzyBeetle.h" -#define NAMESPACE b_area_isk_part_2_tutankoopa +#define NAMESPACE A(tutankoopa) -extern ActorBlueprint b_area_isk_part_2_chain_chomp; +extern ActorBlueprint A(chain_chomp); extern EvtScript N(EVS_Init); extern EvtScript N(EVS_TakeTurn); extern EvtScript N(EVS_Idle); @@ -955,7 +952,7 @@ EvtScript N(EVS_DropDebris_Players) = { Vec3i N(SummonedChompPos) = { 190, 0, 0 }; Formation N(SummonedChomp) = { - ACTOR_BY_POS(b_area_isk_part_2_chain_chomp, N(SummonedChompPos), 100), + ACTOR_BY_POS(A(chain_chomp), N(SummonedChompPos), 100), }; EvtScript N(EVS_Move_SummonChomp) = { @@ -1017,7 +1014,7 @@ EvtScript N(EVS_Move_SummonChomp) = { EVT_CALL(StopSound, SOUND_26B) EVT_WAIT(10) // create the chomp and have him exit the gate - EVT_CALL(SummonEnemy, EVT_PTR(N(SummonedChomp)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(SummonedChomp)), FALSE) EVT_SET(LVarB, LVar0) EVT_SET(LVar0, 165) EVT_SET(LVar1, 0) diff --git a/src/battle/area/isk_part_2/area.c b/src/battle/area/isk_part_2/area.c index be691857fc..07d025e912 100644 --- a/src/battle/area/isk_part_2/area.c +++ b/src/battle/area/isk_part_2/area.c @@ -1,46 +1,43 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_isk_part_2 +extern ActorBlueprint A(tutankoopa); -extern ActorBlueprint N(tutankoopa); +extern Stage A(isk_00); +extern Stage A(isk_01); +extern Stage A(isk_02); +extern Stage A(isk_02b); +extern Stage A(isk_02c); +extern Stage A(isk_03); +extern Stage A(isk_03b); +extern Stage A(isk_04); +extern Stage A(isk_05); +extern Stage A(isk_06); +extern Stage A(isk_06b); +extern Stage A(isk_07); -extern Stage N(isk_00); -extern Stage N(isk_01); -extern Stage N(isk_02); -extern Stage N(isk_02b); -extern Stage N(isk_02c); -extern Stage N(isk_03); -extern Stage N(isk_03b); -extern Stage N(isk_04); -extern Stage N(isk_05); -extern Stage N(isk_06); -extern Stage N(isk_06b); -extern Stage N(isk_07); +Vec3i A(BossPos) = { 97, 70, 17 }; -Vec3i N(BossPos) = { 97, 70, 17 }; - -Formation N(Formation_00) = { - ACTOR_BY_POS(N(tutankoopa), N(BossPos), 10), +Formation A(Formation_00) = { + ACTOR_BY_POS(A(tutankoopa), A(BossPos), 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(isk_01), "カーメン ワンワン"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(isk_01), "カーメン ワンワン"), {}, }; -StageList N(Stages) = { - STAGE("isk_00", N(isk_00)), - STAGE("isk_01", N(isk_01)), - STAGE("isk_02", N(isk_02)), - STAGE("isk_02b", N(isk_02b)), - STAGE("isk_02c", N(isk_02c)), - STAGE("isk_03", N(isk_03)), - STAGE("isk_03b", N(isk_03b)), - STAGE("isk_04", N(isk_04)), - STAGE("isk_05", N(isk_05)), - STAGE("isk_06", N(isk_06)), - STAGE("isk_06b", N(isk_06b)), - STAGE("isk_07", N(isk_07)), +StageList A(Stages) = { + STAGE("isk_00", A(isk_00)), + STAGE("isk_01", A(isk_01)), + STAGE("isk_02", A(isk_02)), + STAGE("isk_02b", A(isk_02b)), + STAGE("isk_02c", A(isk_02c)), + STAGE("isk_03", A(isk_03)), + STAGE("isk_03b", A(isk_03b)), + STAGE("isk_04", A(isk_04)), + STAGE("isk_05", A(isk_05)), + STAGE("isk_06", A(isk_06)), + STAGE("isk_06b", A(isk_06b)), + STAGE("isk_07", A(isk_07)), {}, }; diff --git a/src/battle/area/isk_part_2/area.h b/src/battle/area/isk_part_2/area.h new file mode 100644 index 0000000000..4eb9e14dce --- /dev/null +++ b/src/battle/area/isk_part_2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_isk_part_2 diff --git a/src/battle/area/isk_part_2/stage/isk_00.c b/src/battle/area/isk_part_2/stage/isk_00.c index 779dd9821a..511a491dbc 100644 --- a/src/battle/area/isk_part_2/stage/isk_00.c +++ b/src/battle/area/isk_part_2/stage/isk_00.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_00 - -#include "battle/common/stage/isk_00.inc.c" +#include "battle/common/stage/area_isk/isk_00.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_01.c b/src/battle/area/isk_part_2/stage/isk_01.c index 3d125db233..6565b53327 100644 --- a/src/battle/area/isk_part_2/stage/isk_01.c +++ b/src/battle/area/isk_part_2/stage/isk_01.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_01 - -#include "battle/common/stage/isk_01.inc.c" +#include "battle/common/stage/area_isk/isk_01.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_02.c b/src/battle/area/isk_part_2/stage/isk_02.c index 634c392c30..0a1808cc01 100644 --- a/src/battle/area/isk_part_2/stage/isk_02.c +++ b/src/battle/area/isk_part_2/stage/isk_02.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_02 - -#include "battle/common/stage/isk_02.inc.c" +#include "battle/common/stage/area_isk/isk_02.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_02b.c b/src/battle/area/isk_part_2/stage/isk_02b.c index 4f13f91dd1..6de14d4933 100644 --- a/src/battle/area/isk_part_2/stage/isk_02b.c +++ b/src/battle/area/isk_part_2/stage/isk_02b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_02b - -#include "battle/common/stage/isk_02b.inc.c" +#include "battle/common/stage/area_isk/isk_02b.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_02c.c b/src/battle/area/isk_part_2/stage/isk_02c.c index 7e9490118a..c34fd0ff49 100644 --- a/src/battle/area/isk_part_2/stage/isk_02c.c +++ b/src/battle/area/isk_part_2/stage/isk_02c.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_02c - -#include "battle/common/stage/isk_02c.inc.c" +#include "battle/common/stage/area_isk/isk_02c.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_03.c b/src/battle/area/isk_part_2/stage/isk_03.c index 065b379dd6..6f9e1ca0a3 100644 --- a/src/battle/area/isk_part_2/stage/isk_03.c +++ b/src/battle/area/isk_part_2/stage/isk_03.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_03 - -#include "battle/common/stage/isk_03.inc.c" +#include "battle/common/stage/area_isk/isk_03.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_03b.c b/src/battle/area/isk_part_2/stage/isk_03b.c index 83d6eb381b..f30723af88 100644 --- a/src/battle/area/isk_part_2/stage/isk_03b.c +++ b/src/battle/area/isk_part_2/stage/isk_03b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_03b - -#include "battle/common/stage/isk_03b.inc.c" +#include "battle/common/stage/area_isk/isk_03b.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_04.c b/src/battle/area/isk_part_2/stage/isk_04.c index 3e79d18451..a6399c4643 100644 --- a/src/battle/area/isk_part_2/stage/isk_04.c +++ b/src/battle/area/isk_part_2/stage/isk_04.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_04 - -#include "battle/common/stage/isk_04.inc.c" +#include "battle/common/stage/area_isk/isk_04.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_05.c b/src/battle/area/isk_part_2/stage/isk_05.c index 060a1b7f60..6ee206c608 100644 --- a/src/battle/area/isk_part_2/stage/isk_05.c +++ b/src/battle/area/isk_part_2/stage/isk_05.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_05 - -#include "battle/common/stage/isk_05.inc.c" +#include "battle/common/stage/area_isk/isk_05.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_06.c b/src/battle/area/isk_part_2/stage/isk_06.c index 37d9132bbd..f9059ee50d 100644 --- a/src/battle/area/isk_part_2/stage/isk_06.c +++ b/src/battle/area/isk_part_2/stage/isk_06.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_06 - -#include "battle/common/stage/isk_06.inc.c" +#include "battle/common/stage/area_isk/isk_06.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_06b.c b/src/battle/area/isk_part_2/stage/isk_06b.c index 93341a80bd..48e42e9737 100644 --- a/src/battle/area/isk_part_2/stage/isk_06b.c +++ b/src/battle/area/isk_part_2/stage/isk_06b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_06b - -#include "battle/common/stage/isk_06b.inc.c" +#include "battle/common/stage/area_isk/isk_06b.inc.c" diff --git a/src/battle/area/isk_part_2/stage/isk_07.c b/src/battle/area/isk_part_2/stage/isk_07.c index 58f586299b..671349f7c5 100644 --- a/src/battle/area/isk_part_2/stage/isk_07.c +++ b/src/battle/area/isk_part_2/stage/isk_07.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_isk_part_2_isk_07 - -#include "battle/common/stage/isk_07.inc.c" +#include "battle/common/stage/area_isk/isk_07.inc.c" diff --git a/src/battle/area/iwa/actor/buzzar.c b/src/battle/area/iwa/actor/buzzar.c index 1d3659780d..722b51ee88 100644 --- a/src/battle/area/iwa/actor/buzzar.c +++ b/src/battle/area/iwa/actor/buzzar.c @@ -1,12 +1,9 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/Buzzar.h" #include "battle/action_cmd/break_free.h" #include "battle/action_cmd/whirlwind.h" -#define NAMESPACE b_area_iwa_buzzar +#define NAMESPACE A(buzzar) extern EvtScript N(EVS_Init); extern EvtScript N(EVS_TakeTurn); @@ -198,30 +195,30 @@ EvtScript N(EVS_HandleEvent) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021FC34)) EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) @@ -229,31 +226,31 @@ EvtScript N(EVS_HandleEvent) = { EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) EVT_EXEC_WAIT(N(EVS_FlyToHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Buzzar_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/iwa/actor/cleft.c b/src/battle/area/iwa/actor/cleft.c index 4169c9b8a1..39c1b9636e 100644 --- a/src/battle/area/iwa/actor/cleft.c +++ b/src/battle/area/iwa/actor/cleft.c @@ -1,552 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Cleft.h" +#include "../area.h" -#define NAMESPACE b_area_iwa_cleft - -extern s32 N(IdleAnimations_80218838)[]; -extern EvtScript N(init_802188D0); -extern EvtScript N(idle_80218934); -extern EvtScript N(takeTurn_8021A3EC); -extern EvtScript N(handleEvent_80218C3C); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable_80218710)[] = { - ELEMENT_NORMAL, 2, - ELEMENT_FIRE, 99, - ELEMENT_MAGIC, 0, - ELEMENT_END, -}; - -s32 N(DefenseTable_8021872C)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_FIRE, 99, - ELEMENT_END, -}; - -s32 N(StatusTable_80218740)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 40, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 50, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 22 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80218838), - .defenseTable = N(DefenseTable_80218710), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_CLEFT, - .level = 10, - .maxHP = 2, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_802188D0), - .statusTable = N(StatusTable_80218740), - .escapeChance = 80, - .airLiftChance = 40, - .hurricaneChance = 40, - .spookChance = 40, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 95, - .coinReward = 2, - .size = { 44, 36 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_80218838)[] = { - STATUS_KEY_NORMAL, ANIM_Cleft_Anim02, - STATUS_KEY_STONE, ANIM_Cleft_Anim00, - STATUS_KEY_SLEEP, ANIM_Cleft_Anim0C, - STATUS_KEY_POISON, ANIM_Cleft_Anim02, - STATUS_KEY_STOP, ANIM_Cleft_Anim00, - STATUS_KEY_STATIC, ANIM_Cleft_Anim02, - STATUS_KEY_PARALYZE, ANIM_Cleft_Anim00, - STATUS_KEY_DIZZY, ANIM_Cleft_Anim0E, - STATUS_KEY_FEAR, ANIM_Cleft_Anim0E, - STATUS_END, -}; - -s32 N(IdleAnimations_80218884)[] = { - STATUS_KEY_NORMAL, ANIM_Cleft_Anim05, - STATUS_KEY_STONE, ANIM_Cleft_Anim01, - STATUS_KEY_SLEEP, ANIM_Cleft_Anim0D, - STATUS_KEY_POISON, ANIM_Cleft_Anim05, - STATUS_KEY_STOP, ANIM_Cleft_Anim01, - STATUS_KEY_STATIC, ANIM_Cleft_Anim05, - STATUS_KEY_PARALYZE, ANIM_Cleft_Anim01, - STATUS_KEY_DIZZY, ANIM_Cleft_Anim0F, - STATUS_KEY_FEAR, ANIM_Cleft_Anim0F, - STATUS_END, -}; - -#include "common/SetSpinSmashable.inc.c" - -#include "common/StartRumbleWithParams.inc.c" - -EvtScript N(init_802188D0) = { - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80218934))) - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021A3EC))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80218C3C))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_80218934) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(80218944) = { - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_THREAD - EVT_SET(LVar0, 0) - EVT_LOOP(5) - EVT_ADD(LVar0, -36) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) - EVT_SUB(LVar1, 6) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 200, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) - EVT_END_THREAD - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 40, 8, EVT_FLOAT(0.0), 20, 0) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218884))) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_8021872C))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -7) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) - EVT_CALL(N(SetSpinSmashable), 0) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80218C3C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_CALL(GetLastElement, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_FLAG(DAMAGE_TYPE_BLAST) - EVT_EXEC_WAIT(N(80218944)) - EVT_CASE_DEFAULT - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_SWITCH - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_CALL(GetLastElement, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_FLAG(DAMAGE_TYPE_BLAST) - EVT_EXEC_WAIT(N(80218944)) - EVT_CASE_DEFAULT - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_END_IF - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE) - EVT_END_SWITCH - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_CASE_EQ(EVENT_SPIKE_TAUNT) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim18) - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, -3) - EVT_ADD(LVar1, 10) - EVT_ELSE - EVT_ADD(LVar0, -8) - EVT_ADD(LVar1, 27) - EVT_END_IF - EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) - EVT_WAIT(20) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim03) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim02) - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_END_IF - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim07) - EVT_SET_CONST(LVar2, ANIM_Cleft_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim0F) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim0F) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(802197AC) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(3.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) - EVT_WAIT(20) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim05) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_IF_GT(LVar0, 0) - EVT_SUB(LVar0, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, LVar0) - EVT_ELSE - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) - EVT_THREAD - EVT_WAIT(3) - EVT_LOOP(5) - EVT_ADD(LVar0, 36) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar1, 6) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 200, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) - EVT_END_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218838))) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_80218710))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 22) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) - EVT_WAIT(1) - EVT_CALL(N(SetSpinSmashable), 1) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) - EVT_END_IF - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80219BA0) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 30) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(10) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(5) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim10) - EVT_WAIT(10) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, -5) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim00) - EVT_WAIT(8) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 2, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_THREAD - EVT_WAIT(10) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_THREAD - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 100) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 45) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim08) - EVT_WAIT(15) - EVT_WAIT(8) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 15) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.4)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021A3EC) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_EXEC_WAIT(N(802197AC)) - EVT_ELSE - EVT_EXEC_WAIT(N(80219BA0)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/cleft.inc.c" diff --git a/src/battle/area/iwa/actor/monty_mole.c b/src/battle/area/iwa/actor/monty_mole.c index 45c62b31ee..0990516372 100644 --- a/src/battle/area/iwa/actor/monty_mole.c +++ b/src/battle/area/iwa/actor/monty_mole.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_iwa_monty_mole +#include "../area.h" #include "battle/common/actor/monty_mole.inc.c" diff --git a/src/battle/area/iwa/actor/whacka.c b/src/battle/area/iwa/actor/whacka.c index cca2705150..525ec2b839 100644 --- a/src/battle/area/iwa/actor/whacka.c +++ b/src/battle/area/iwa/actor/whacka.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_iwa_whacka +#include "../area.h" #include "battle/common/actor/whacka.inc.c" diff --git a/src/battle/area/iwa/area.c b/src/battle/area/iwa/area.c index 699a12146d..9cd0569046 100644 --- a/src/battle/area/iwa/area.c +++ b/src/battle/area/iwa/area.c @@ -1,115 +1,112 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_iwa +extern ActorBlueprint A(cleft); +extern ActorBlueprint A(monty_mole); +extern ActorBlueprint A(whacka); +extern ActorBlueprint A(buzzar); -extern ActorBlueprint N(cleft); -extern ActorBlueprint N(monty_mole); -extern ActorBlueprint N(whacka); -extern ActorBlueprint N(buzzar); +extern Stage A(iwa_01); +extern Stage A(iwa_01b); +extern Stage A(iwa_02); -extern Stage N(iwa_01); -extern Stage N(iwa_01b); -extern Stage N(iwa_02); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_B, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_C, 8), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_C, 9), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_C, 8), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_B, 10), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_C, 9), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_C, 8), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_D, 7), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_C, 9), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_C, 8), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_C, 8), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_C, 8), }; -Vec3i N(vector3D_8021853C) = { 90, 70, 0 }; +Vec3i A(vector3D_8021853C) = { 90, 70, 0 }; -Formation N(Formation_0C) = { - ACTOR_BY_POS(N(buzzar), N(vector3D_8021853C), 10), +Formation A(Formation_0C) = { + ACTOR_BY_POS(A(buzzar), A(vector3D_8021853C), 10), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(cleft), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(monty_mole), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(whacka), BTL_POS_GROUND_C, 8), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(cleft), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(monty_mole), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(whacka), BTL_POS_GROUND_C, 8), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(iwa_01), "シンエモン"), - BATTLE(N(Formation_01), N(iwa_01), "シンエモンx2"), - BATTLE(N(Formation_02), N(iwa_01), "シンエモンx3"), - BATTLE(N(Formation_03), N(iwa_01), "シンエモン,チョロプー"), - BATTLE(N(Formation_04), N(iwa_01), "シンエモン,チョロプーx2"), - BATTLE(N(Formation_05), N(iwa_01), "チョロプー"), - BATTLE(N(Formation_06), N(iwa_01), "チョロプーx2"), - BATTLE(N(Formation_07), N(iwa_01), "チョロプーx3"), - BATTLE(N(Formation_08), N(iwa_01), "チョロプーx4"), - BATTLE(N(Formation_09), N(iwa_01), "チョロプー,シンエモン"), - BATTLE(N(Formation_0A), N(iwa_01), "チョロプーx2,シンエモン"), - BATTLE(N(Formation_0B), N(iwa_01), "チョロプー,シンエモン,チョロプー"), - BATTLE(N(Formation_0C), N(iwa_02), "ゲーハー"), - BATTLE(N(Formation_0D), N(iwa_02), "コブロン"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(iwa_01), "シンエモン"), + BATTLE(A(Formation_01), A(iwa_01), "シンエモンx2"), + BATTLE(A(Formation_02), A(iwa_01), "シンエモンx3"), + BATTLE(A(Formation_03), A(iwa_01), "シンエモン,チョロプー"), + BATTLE(A(Formation_04), A(iwa_01), "シンエモン,チョロプーx2"), + BATTLE(A(Formation_05), A(iwa_01), "チョロプー"), + BATTLE(A(Formation_06), A(iwa_01), "チョロプーx2"), + BATTLE(A(Formation_07), A(iwa_01), "チョロプーx3"), + BATTLE(A(Formation_08), A(iwa_01), "チョロプーx4"), + BATTLE(A(Formation_09), A(iwa_01), "チョロプー,シンエモン"), + BATTLE(A(Formation_0A), A(iwa_01), "チョロプーx2,シンエモン"), + BATTLE(A(Formation_0B), A(iwa_01), "チョロプー,シンエモン,チョロプー"), + BATTLE(A(Formation_0C), A(iwa_02), "ゲーハー"), + BATTLE(A(Formation_0D), A(iwa_02), "コブロン"), {}, }; -StageList N(Stages) = { - STAGE("iwa_01", N(iwa_01)), - STAGE("iwa_01b", N(iwa_01b)), - STAGE("iwa_02", N(iwa_02)), +StageList A(Stages) = { + STAGE("iwa_01", A(iwa_01)), + STAGE("iwa_01b", A(iwa_01b)), + STAGE("iwa_02", A(iwa_02)), {}, }; diff --git a/src/battle/area/iwa/area.h b/src/battle/area/iwa/area.h new file mode 100644 index 0000000000..a4555eb5a6 --- /dev/null +++ b/src/battle/area/iwa/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_iwa diff --git a/src/battle/area/iwa/stage/iwa_01.c b/src/battle/area/iwa/stage/iwa_01.c index 854fa93d74..f7fc43abd2 100644 --- a/src/battle/area/iwa/stage/iwa_01.c +++ b/src/battle/area/iwa/stage/iwa_01.c @@ -1,52 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/iwa_bt01_shape.h" +#include "../area.h" -#include "sprite/npc/Whacka.h" - -#define NAMESPACE b_area_iwa_iwa_01 - -extern ActorBlueprint N(whacka); -extern Formation N(WhackaFormation); - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, MODEL_b, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_iwa1, - MODEL_o331, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "iwa_tex", - .shape = "iwa_bt01_shape", - .hit = "iwa_bt01_hit", - .bg = "iwa_bg\0", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), - .stageEnemyCount = 1, - .stageFormation = &N(WhackaFormation), - .stageEnemyChance = 512, -}; - -Vec3i N(WhackaPos) = { 116, 0, -30 }; - -Formation N(WhackaFormation) = { - ACTOR_BY_POS(N(whacka), N(WhackaPos), 0), -}; - -#define NAMESPACE b_area_iwa_iwa_01_whacka -#include "battle/common/actor/whacka.inc.c" -#define NAMESPACE b_area_iwa_iwa_01 +#include "battle/common/stage/area_iwa/iwa_01.inc.c" diff --git a/src/battle/area/iwa/stage/iwa_01b.c b/src/battle/area/iwa/stage/iwa_01b.c index 77c6e3f3e8..bec473876f 100644 --- a/src/battle/area/iwa/stage/iwa_01b.c +++ b/src/battle/area/iwa/stage/iwa_01b.c @@ -1,34 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/iwa_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_iwa_iwa_01b - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, MODEL_a, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_iwa1, - MODEL_o331, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "iwa_tex", - .shape = "iwa_bt01_shape", - .hit = "iwa_bt01_hit", - .bg = "iwa_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_iwa/iwa_01b.inc.c" diff --git a/src/battle/area/iwa/stage/iwa_02.c b/src/battle/area/iwa/stage/iwa_02.c index fb21551f58..4e572f7057 100644 --- a/src/battle/area/iwa/stage/iwa_02.c +++ b/src/battle/area/iwa/stage/iwa_02.c @@ -1,47 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/iwa_bt02_shape.h" +#include "../area.h" -#include "sprite/npc/Whacka.h" - -#define NAMESPACE b_area_iwa_iwa_02 - -extern ActorBlueprint N(whacka); - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o331, - MODEL_iwa1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "iwa_tex", - .shape = "iwa_bt02_shape", - .hit = "iwa_bt02_hit", - .bg = "iwa_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; - -Vec3i N(OriginPos) = { 0, 0, 0 }; - -Formation N(WhackaFormation) = { - ACTOR_BY_POS(N(whacka), N(OriginPos), 0), -}; - -#define NAMESPACE b_area_iwa_iwa_02_whacka -#include "battle/common/actor/whacka.inc.c" -#define NAMESPACE b_area_iwa_iwa_02 +#include "battle/common/stage/area_iwa/iwa_02.inc.c" diff --git a/src/battle/area/jan/actor/hurt_plant.c b/src/battle/area/jan/actor/hurt_plant.c index aac9776852..e276159f4d 100644 --- a/src/battle/area/jan/actor/hurt_plant.c +++ b/src/battle/area/jan/actor/hurt_plant.c @@ -1,352 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/HurtPlant.h" +#include "../area.h" -#define NAMESPACE b_area_jan_hurt_plant - -extern EvtScript N(init_8021DA98); -extern EvtScript N(takeTurn_8021E33C); -extern EvtScript N(idle_8021DAE4); -extern EvtScript N(handleEvent_8021DCF4); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(IdleAnimations_8021D940)[] = { - STATUS_KEY_NORMAL, ANIM_HurtPlant_Anim02, - STATUS_KEY_STONE, ANIM_HurtPlant_Anim00, - STATUS_KEY_SLEEP, ANIM_HurtPlant_Anim0C, - STATUS_KEY_POISON, ANIM_HurtPlant_Anim02, - STATUS_KEY_STOP, ANIM_HurtPlant_Anim00, - STATUS_KEY_STATIC, ANIM_HurtPlant_Anim02, - STATUS_KEY_PARALYZE, ANIM_HurtPlant_Anim00, - STATUS_KEY_DIZZY, ANIM_HurtPlant_Anim09, - STATUS_KEY_FEAR, ANIM_HurtPlant_Anim09, - STATUS_END, -}; - -s32 N(DefenseTable_8021D98C)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_FIRE, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8021D9A0)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 95, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -10, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021D940), - .defenseTable = N(DefenseTable_8021D98C), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -8, -5 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_HURT_PLANT, - .level = 16, - .maxHP = 8, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021DA98), - .statusTable = N(StatusTable_8021D9A0), - .escapeChance = 70, - .airLiftChance = 20, - .hurricaneChance = 20, - .spookChance = 70, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 95, - .coinReward = 1, - .size = { 40, 35 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -18, 23 }, - .statusTextOffset = { 1, 20 }, -}; - -EvtScript N(init_8021DA98) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021E33C))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021DAE4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021DCF4))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_8021DAE4) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_FLAG(STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -6, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -2, -5) - EVT_CALL(N(SetAbsoluteStatusOffsets), -20, 8, 0, 14) - EVT_CASE_DEFAULT - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -10, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -8, -5) - EVT_CALL(N(SetAbsoluteStatusOffsets), -18, 23, 1, 20) - EVT_END_SWITCH - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021DBFC) = { - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim04) - EVT_WAIT(10) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim03) - EVT_WAIT(10) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021DCF4) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) - EVT_WAIT(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0A) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0A) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0A) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) - EVT_WAIT(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) - EVT_WAIT(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) - EVT_WAIT(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8021DBFC)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) - EVT_WAIT(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) - EVT_WAIT(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) - EVT_WAIT(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim04) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_WAIT(20) - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(RemoveActor, ACTOR_SELF) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021E33C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim04) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 1) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 27) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_WAIT(15) - EVT_GOTO(123) - EVT_END_IF - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim04) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_WAIT(8) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 27) - EVT_SET(LVar1, 0) - EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) - EVT_CALL(SetBattleCamZoom, 350) - EVT_CALL(SetBattleCamOffsetZ, 45) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 27) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_LABEL(123) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim03) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim05) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2C4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim06) - EVT_WAIT(6) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim07) - EVT_WAIT(5) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8021DBFC)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_POISON) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_ELSE - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 100), 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_END_IF - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim07) - EVT_WAIT(5) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(8021DBFC)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/hurt_plant.inc.c" diff --git a/src/battle/area/jan/actor/jungle_fuzzy.c b/src/battle/area/jan/actor/jungle_fuzzy.c index 804a0a7252..19a274612d 100644 --- a/src/battle/area/jan/actor/jungle_fuzzy.c +++ b/src/battle/area/jan/actor/jungle_fuzzy.c @@ -1,838 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Fuzzy.h" -#include "battle/action_cmd/stop_leech.h" +#include "../area.h" -#define NAMESPACE b_area_jan_jungle_fuzzy - -extern s32 N(IdleAnimations_8021EADC)[]; -extern EvtScript N(init_8021EB28); -extern EvtScript N(takeTurn_80221628); -extern EvtScript N(idle_8021EB8C); -extern EvtScript N(handleEvent_8021EB9C); -extern Formation N(specialFormation_8022180C); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable_8021E9D0)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_FIRE, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8021E9E4)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 95, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 70, - STATUS_KEY_PARALYZE, 75, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 20 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021EADC), - .defenseTable = N(DefenseTable_8021E9D0), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_JUNGLE_FUZZY, - .level = 16, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021EB28), - .statusTable = N(StatusTable_8021E9E4), - .escapeChance = 30, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 75, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 33, 28 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_8021EADC)[] = { - STATUS_KEY_NORMAL, ANIM_Fuzzy_Jungle_Idle, - STATUS_KEY_STONE, ANIM_Fuzzy_Jungle_Still, - STATUS_KEY_SLEEP, ANIM_Fuzzy_Jungle_Sleep, - STATUS_KEY_POISON, ANIM_Fuzzy_Jungle_Idle, - STATUS_KEY_STOP, ANIM_Fuzzy_Jungle_Still, - STATUS_KEY_STATIC, ANIM_Fuzzy_Jungle_Idle, - STATUS_KEY_PARALYZE, ANIM_Fuzzy_Jungle_Still, - STATUS_KEY_DIZZY, ANIM_Fuzzy_Jungle_Stunned, - STATUS_KEY_FEAR, ANIM_Fuzzy_Jungle_Stunned, - STATUS_END, -}; - -EvtScript N(init_8021EB28) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80221628))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021EB8C))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021EB9C))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_8021EB8C) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021EB9C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_CALL(GetLastElement, LVar0) - EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Burn) - EVT_SET_CONST(LVar2, ANIM_Fuzzy_Jungle_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Burn) - EVT_SET_CONST(LVar2, ANIM_Fuzzy_Jungle_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Run) - EVT_EXEC_WAIT(EVS_Enemy_HopHome) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_CALL(GetLastElement, LVar0) - EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Run) - EVT_SET_CONST(LVar2, ANIM_Fuzzy_Jungle_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Run) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(divide) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) - EVT_CALL(SetBattleCamZoom, 330) - EVT_CALL(SetBattleCamOffsetZ, 30) - EVT_CALL(MoveBattleCamOver, 20) - EVT_WAIT(20) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) - EVT_THREAD - EVT_WAIT(30) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206E) - EVT_WAIT(30) - EVT_LOOP(4) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206F) - EVT_WAIT(11) - EVT_END_LOOP - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2070) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Anim0D) - EVT_WAIT(130) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Walk) - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8022180C)), 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(SetActorPos, LVar0, LVar1, LVar2, LVar3) - EVT_CALL(SetGoalToIndex, LVar0, LVarA) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 20) - EVT_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Walk) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(JumpToGoal, ACTOR_SELF, 14, FALSE, TRUE, FALSE) - EVT_END_THREAD - EVT_WAIT(1) - EVT_CALL(SetAnimation, LVar0, 1, ANIM_Fuzzy_Jungle_Walk) - EVT_CALL(SetActorJumpGravity, LVar0, EVT_FLOAT(1.4)) - EVT_CALL(JumpToGoal, LVar0, 14, FALSE, TRUE, FALSE) - EVT_CALL(GetActorPos, LVar0, LVar1, LVar2, LVar3) - EVT_CALL(ForceHomePos, LVar0, LVar1, LVar2, LVar3) - EVT_CALL(HPBarToHome, LVar0) - EVT_CALL(SetAnimation, LVar0, 1, ANIM_Fuzzy_Jungle_Idle) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar1) - EVT_SWITCH(LVar1) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, LVar0, 0, 1) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, LVar0, 0, 2) - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/SpawnEnemyDrainFX.inc.c" - -EvtScript N(leechAttack) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_GOTO(100) - EVT_END_IF - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle) - EVT_LABEL(100) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Anim04) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 9, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) - EVT_WAIT(5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 2, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_SET(LVar1, 0) - EVT_SUB(LVar2, 5) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 11, FALSE, TRUE, FALSE) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Anim09) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 15) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_WAIT(4) - EVT_WAIT(5) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(5) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_EQ(HIT_RESULT_HIT_STATIC) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_STATIC) - EVT_SET(LFlag0, FALSE) - EVT_ELSE - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, -3, -12, -15) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 0, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAG_STONE) - EVT_WAIT(10) - EVT_LOOP(2) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Bite) - EVT_WAIT(21) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Still) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, -3, -2, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.9), EVT_FLOAT(1.2), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.8), EVT_FLOAT(1.3), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) - EVT_WAIT(2) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.6), EVT_FLOAT(1.6), EVT_FLOAT(1.0)) - EVT_WAIT(10) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 2, BS_FLAGS1_40) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) - EVT_WAIT(30) - EVT_END_LOOP - EVT_ELSE - EVT_CALL(ShowMessageBox, BTL_MSG_ACTION_TIP_03, 0x00007FFF) - EVT_CALL(ShowActionHud, TRUE) - EVT_CALL(LoadActionCommand, ACTION_COMMAND_STOP_LEECH) - EVT_CALL(action_command_stop_leech_init) - EVT_CALL(SetupMashMeter, 1, 23, 0, 0, 0, 0) - EVT_WAIT(10) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_4000, FALSE) - EVT_CALL(action_command_stop_leech_start, 0, 32767, 3) - EVT_SET(LVarD, 0) - EVT_LOOP(5) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE) - EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Leeching) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Bite) - EVT_SET(LFlag0, FALSE) - EVT_LOOP(21) - EVT_CALL(GetActionSuccessCopy, LVar1) - EVT_IF_EQ(LVar1, 1) - EVT_SET(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Still) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, -3, -2, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_SET(LFlag0, FALSE) - EVT_LOOP(1) - EVT_CALL(GetActionSuccessCopy, LVar1) - EVT_IF_EQ(LVar1, 1) - EVT_SET(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.9), EVT_FLOAT(1.2), EVT_FLOAT(1.0)) - EVT_SET(LFlag0, FALSE) - EVT_LOOP(1) - EVT_CALL(GetActionSuccessCopy, LVar1) - EVT_IF_EQ(LVar1, 1) - EVT_SET(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.8), EVT_FLOAT(1.3), EVT_FLOAT(1.0)) - EVT_SET(LFlag0, FALSE) - EVT_LOOP(1) - EVT_CALL(GetActionSuccessCopy, LVar1) - EVT_IF_EQ(LVar1, 1) - EVT_SET(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) - EVT_SET(LFlag0, FALSE) - EVT_LOOP(1) - EVT_CALL(GetActionSuccessCopy, LVar1) - EVT_IF_EQ(LVar1, 1) - EVT_SET(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) - EVT_SET(LFlag0, FALSE) - EVT_LOOP(2) - EVT_CALL(GetActionSuccessCopy, LVar1) - EVT_IF_EQ(LVar1, 1) - EVT_SET(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.6), EVT_FLOAT(1.6), EVT_FLOAT(1.0)) - EVT_SET(LFlag0, FALSE) - EVT_LOOP(10) - EVT_CALL(GetActionSuccessCopy, LVar1) - EVT_IF_EQ(LVar1, 1) - EVT_SET(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_SET(LFlag0, FALSE) - EVT_LOOP(2) - EVT_CALL(GetActionSuccessCopy, LVar1) - EVT_IF_EQ(LVar1, 1) - EVT_SET(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_UNBLOCKABLE | DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 2, BS_FLAGS1_40) - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar3) - EVT_IF_NE(LVar3, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_214) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 10) - EVT_CALL(N(SpawnDrainHealthStartFX), LVar0, LVar1, LVar2, LVar3) - EVT_THREAD - EVT_WAIT(15) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_25C) - EVT_CALL(N(SpawnDrainHealthContinueFX), LVar0, LVar1, LVar2, LVar3) - EVT_END_THREAD - EVT_ADD(LVar0, 20) - EVT_ADD(LVar1, 20) - EVT_PLAY_EFFECT(EFFECT_RECOVER, 0, LVar0, LVar1, LVar2, LVar3, 0) - EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) - EVT_ADD(LVar0, LVar3) - EVT_CALL(SetEnemyHP, ACTOR_SELF, LVar0) - EVT_ELSE - EVT_ADD(LVarD, 1) - EVT_IF_GT(LVarD, 1) - EVT_CALL(func_80269470) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) - EVT_CALL(GetPlayerHP, LVar1) - EVT_IF_EQ(LVar1, 0) - EVT_CALL(func_80269470) - EVT_BREAK_LOOP - EVT_END_IF - EVT_SET(LFlag0, FALSE) - EVT_LOOP(35) - EVT_CALL(GetActionSuccessCopy, LVar1) - EVT_IF_EQ(LVar1, 1) - EVT_SET(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LFlag0, TRUE) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_CALL(func_80269470) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) - EVT_END_IF - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_THREAD - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.6), EVT_FLOAT(0.6), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 300) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 270) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(0.7), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 240) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 210) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 180) - EVT_WAIT(2) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(0.7), EVT_FLOAT(1.0)) - EVT_WAIT(2) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.2), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_END_THREAD - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.4), EVT_FLOAT(0.2), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.2), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 150) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 120) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 90) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 60) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 30) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(802210E0) = { - EVT_SET(LFlag1, FALSE) - EVT_SET(LFlag2, FALSE) - EVT_SET(LFlag3, FALSE) - EVT_SET(LFlag4, FALSE) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar5) - EVT_CALL(GetIndexFromHome, LVar0, LVar5) - EVT_MOD(LVar5, 4) - EVT_SWITCH(LVar5) - EVT_CASE_EQ(0) - EVT_SET(LFlag1, TRUE) - EVT_CASE_EQ(1) - EVT_SET(LFlag2, TRUE) - EVT_CASE_EQ(2) - EVT_SET(LFlag3, TRUE) - EVT_CASE_EQ(3) - EVT_SET(LFlag4, TRUE) - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_SET(LVarA, -1) - EVT_SET(LVarB, -1) - EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_IF_EQ(LFlag2, FALSE) - EVT_SET(LVarA, 1) - EVT_END_IF - EVT_CASE_EQ(1) - EVT_IF_EQ(LFlag1, FALSE) - EVT_SET(LVarA, 0) - EVT_END_IF - EVT_IF_EQ(LFlag3, FALSE) - EVT_IF_EQ(LVarA, -1) - EVT_SET(LVarA, 2) - EVT_ELSE - EVT_SET(LVarB, 2) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(2) - EVT_IF_EQ(LFlag2, FALSE) - EVT_SET(LVarA, 1) - EVT_END_IF - EVT_IF_EQ(LFlag4, FALSE) - EVT_IF_EQ(LVarA, -1) - EVT_SET(LVarA, 3) - EVT_ELSE - EVT_SET(LVarB, 3) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(3) - EVT_IF_EQ(LFlag3, FALSE) - EVT_SET(LVarA, 2) - EVT_END_IF - EVT_END_SWITCH - EVT_IF_NE(LVarB, -1) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 500) - EVT_SET(LVarA, LVarB) - EVT_END_IF - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(80221468) = { - EVT_SET(LVar9, 0) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetOriginalActorType, LVar0, LVar2) - EVT_SWITCH(LVar2) - EVT_CASE_OR_EQ(ACTOR_TYPE_FOREST_FUZZY) - EVT_CASE_OR_EQ(ACTOR_TYPE_JUNGLE_FUZZY) - EVT_CALL(GetStatusFlags, LVar0, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(GetActorVar, LVar0, 0, LVar3) - EVT_IF_NE(LVar3, 2) - EVT_ADD(LVar9, 1) - EVT_END_IF - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(ACTOR_TYPE_SPEAR_GUY) - EVT_CALL(GetStatusFlags, LVar0, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(GetActorVar, LVar0, 1, LVar3) - EVT_IF_LT(LVar3, 2) - EVT_ADD(LVar9, 1) - EVT_END_IF - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_80221628) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_EXEC_WAIT(N(leechAttack)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 2) - EVT_EXEC_WAIT(N(leechAttack)) - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(802210E0)) - EVT_IF_EQ(LVarA, -1) - EVT_EXEC_WAIT(N(leechAttack)) - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(80221468)) - EVT_SWITCH(LVar9) - EVT_CASE_EQ(1) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 400) - EVT_EXEC_WAIT(N(divide)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(2) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 150) - EVT_EXEC_WAIT(N(divide)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(3) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 70) - EVT_EXEC_WAIT(N(divide)) - EVT_RETURN - EVT_END_IF - EVT_END_SWITCH - EVT_EXEC_WAIT(N(leechAttack)) - EVT_RETURN - EVT_END -}; - -Vec3i N(vector3D_80221800) = { NPC_DISPOSE_LOCATION }; - -Formation N(specialFormation_8022180C) = { - ACTOR_BY_POS(NAMESPACE, N(vector3D_80221800), 0), -}; +#include "battle/common/actor/jungle_fuzzy.inc.c" diff --git a/src/battle/area/jan/actor/m_bush.c b/src/battle/area/jan/actor/m_bush.c index ce0f3cd6d4..8038247c3a 100644 --- a/src/battle/area/jan/actor/m_bush.c +++ b/src/battle/area/jan/actor/m_bush.c @@ -1,299 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/MBush.h" +#include "../area.h" -#define NAMESPACE b_area_jan_m_bush - -extern EvtScript N(init_80221988); -extern EvtScript N(takeTurn_80221F78); -extern EvtScript N(idle_802219D4); -extern EvtScript N(handleEvent_80221A74); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(IdleAnimations_80221830)[] = { - STATUS_KEY_NORMAL, ANIM_MBush_Anim02, - STATUS_KEY_STONE, ANIM_MBush_Anim01, - STATUS_KEY_SLEEP, ANIM_MBush_Anim08, - STATUS_KEY_POISON, ANIM_MBush_Anim02, - STATUS_KEY_STOP, ANIM_MBush_Anim01, - STATUS_KEY_STATIC, ANIM_MBush_Anim02, - STATUS_KEY_PARALYZE, ANIM_MBush_Anim01, - STATUS_KEY_DIZZY, ANIM_MBush_Anim09, - STATUS_KEY_FEAR, ANIM_MBush_Anim09, - STATUS_END, -}; - -s32 N(DefenseTable_8022187C)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_FIRE, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_80221890)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 95, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts_8022193C)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -2, 22 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80221830), - .defenseTable = N(DefenseTable_8022187C), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_M_BUSH, - .level = 16, - .maxHP = 8, - .partCount = ARRAY_COUNT( N(ActorParts_8022193C)), - .partsData = N(ActorParts_8022193C), - .initScript = &N(init_80221988), - .statusTable = N(StatusTable_80221890), - .escapeChance = 70, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 60, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 85, - .coinReward = 1, - .size = { 32, 30 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(init_80221988) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80221F78))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_802219D4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80221A74))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_802219D4) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(802219E4) = { - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim05) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim02) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80221A74) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim0A) - EVT_SET_CONST(LVar2, ANIM_MBush_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim0A) - EVT_SET_CONST(LVar2, ANIM_MBush_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(802219E4)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim05) - EVT_SET_CONST(LVar2, ANIM_MBush_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim05) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_MBush_Anim05) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_80221F78) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_20C9, 0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim06) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim02) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(802219E4)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim06) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 2, 25), 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim02) - EVT_WAIT(8) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(802219E4)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/m_bush.inc.c" diff --git a/src/battle/area/jan/actor/medi_guy.c b/src/battle/area/jan/actor/medi_guy.c index af325ae372..467cbb55b5 100644 --- a/src/battle/area/jan/actor/medi_guy.c +++ b/src/battle/area/jan/actor/medi_guy.c @@ -1,9 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/MediGuy.h" - -#define NAMESPACE b_area_jan_medi_guy +#include "../area.h" #include "battle/common/actor/medi_guy.inc.c" diff --git a/src/battle/area/jan/actor/spear_guy.c b/src/battle/area/jan/actor/spear_guy.c index 4935f7665a..af40e23a5b 100644 --- a/src/battle/area/jan/actor/spear_guy.c +++ b/src/battle/area/jan/actor/spear_guy.c @@ -1,1509 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ShyGuy.h" -#include "sprite/npc/SpearGuy.h" +#include "../area.h" -#define NAMESPACE b_area_jan_spear_guy - -extern s32 N(IdleAnimations_8021BF40)[]; -extern EvtScript N(init_80218980); -extern EvtScript N(takeTurn_8021BCB4); -extern EvtScript N(handleEvent_80218E3C); -extern EvtScript N(nextTurn_80218B24); -extern EvtScript N(idle_80218BE0); -extern EvtScript N(takeTurn_8021D8D8); -extern EvtScript N(idle_8021BFD8); -extern EvtScript N(handleEvent_8021C14C); -extern EvtScript N(8021BF8C); -extern Formation N(specialFormation_8021A8C0); -extern Formation N(specialFormation_8021A8DC); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, -}; - -s32 N(IdleAnimations_802185C0)[] = { - STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim04, - STATUS_KEY_STONE, ANIM_SpearGuy_Anim02, - STATUS_KEY_SLEEP, ANIM_SpearGuy_Anim0D, - STATUS_KEY_POISON, ANIM_SpearGuy_Anim0F, - STATUS_KEY_STOP, ANIM_SpearGuy_Anim02, - STATUS_KEY_STATIC, ANIM_SpearGuy_Anim04, - STATUS_KEY_PARALYZE, ANIM_SpearGuy_Anim02, - STATUS_KEY_DIZZY, ANIM_SpearGuy_Anim0F, - STATUS_KEY_FEAR, ANIM_SpearGuy_Anim0F, - STATUS_END, -}; - -s32 N(IdleAnimations_8021860C)[] = { - STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim03, - STATUS_KEY_STONE, ANIM_SpearGuy_Anim0D, - STATUS_KEY_SLEEP, ANIM_SpearGuy_Anim0D, - STATUS_KEY_POISON, ANIM_SpearGuy_Anim0F, - STATUS_KEY_STOP, ANIM_SpearGuy_Anim01, - STATUS_KEY_STATIC, ANIM_SpearGuy_Anim03, - STATUS_KEY_PARALYZE, ANIM_SpearGuy_Anim01, - STATUS_KEY_DIZZY, ANIM_SpearGuy_Anim0F, - STATUS_KEY_FEAR, ANIM_SpearGuy_Anim0F, - STATUS_END, -}; - -s32 N(IdleAnimations_80218658)[] = { - STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim14, - STATUS_END, -}; - -s32 N(IdleAnimations_80218664)[] = { - STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim19, - STATUS_END, -}; - -s32 N(DefenseTable_80218670)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_FIRE, 0, - ELEMENT_END, -}; - -s32 N(DefenseTable_80218684)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_SHOCK, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_80218698)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 80, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -s32 N(StatusTable_80218744)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 22 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_802185C0), - .defenseTable = N(DefenseTable_80218670), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_FRONT, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -3, -8 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021BF40), - .defenseTable = N(DefenseTable_80218684), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 0 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80218658), - .defenseTable = N(DefenseTable_80218684), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_4, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 0 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80218664), - .defenseTable = N(DefenseTable_80218684), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_SPEAR_GUY, - .level = 16, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_80218980), - .statusTable = N(StatusTable_80218698), - .escapeChance = 50, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 70, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 85, - .coinReward = 2, - .size = { 24, 24 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(setSpearStance) = { - EVT_SWITCH(LVar0) - EVT_CASE_EQ(2) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_802185C0))) - EVT_CALL(SetPartEventFlags, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021860C))) - EVT_CALL(SetPartEventFlags, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(init_80218980) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(setSpearStance)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim04) - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(setSpearStance)) - EVT_CALL(SetPartEventFlags, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim03) - EVT_END_SWITCH - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021BCB4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80218E3C))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_80218B24))) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_CALL(GetEncounterState, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(2) - EVT_CASE_OR_EQ(4) - EVT_CASE_OR_EQ(6) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT, FALSE) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021860C))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim03) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(nextTurn_80218B24) = { - EVT_CALL(BindNextTurn, ACTOR_SELF, 0) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80218BE0))) - EVT_RETURN - EVT_END -}; - -EvtScript N(80218B5C) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_EQ(LVarA, 0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarB) - EVT_IF_FLAG(LVarB, STATUS_FLAG_SLEEP | STATUS_FLAG_FEAR | STATUS_FLAG_DIZZY) - EVT_ELSE - EVT_SET(LVar1, LVar2) - EVT_END_IF - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_80218BE0) = { - EVT_LABEL(0) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP | STATUS_FLAG_FEAR | STATUS_FLAG_DIZZY) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021860C))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT, FALSE) - EVT_ELSE - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_802185C0))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT, TRUE) - EVT_END_IF - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021860C))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT, FALSE) - EVT_END_SWITCH - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80218D7C) = { - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim04) - EVT_CASE_EQ(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim03) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80218E3C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) - EVT_EXEC_WAIT(N(80218B5C)) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarB) - EVT_IF_FLAG(LVarB, STATUS_FLAG_SLEEP | STATUS_FLAG_FEAR | STATUS_FLAG_DIZZY) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0A) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim0C) - EVT_ELSE - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0B) - EVT_SET_CONST(LVar2, -1) - EVT_END_IF - EVT_ELSE - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0A) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim0C) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarB) - EVT_IF_FLAG(LVarB, STATUS_FLAG_SLEEP | STATUS_FLAG_FEAR | STATUS_FLAG_DIZZY) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0A) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0B) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_ELSE - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0A) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) - EVT_EXEC_WAIT(N(80218B5C)) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) - EVT_EXEC_WAIT(N(80218B5C)) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim09) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) - EVT_EXEC_WAIT(N(80218B5C)) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) - EVT_EXEC_WAIT(N(80218B5C)) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) - EVT_EXEC_WAIT(N(80218B5C)) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(80218D7C)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim03) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim04) - EVT_EXEC_WAIT(N(80218B5C)) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) - EVT_EXEC_WAIT(N(80218B5C)) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim09) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) - EVT_EXEC_WAIT(N(80218B5C)) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_END_SWITCH - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim06) - EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIKE_TAUNT) - EVT_WAIT(10) - EVT_SET(LFlag0, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_SWITCH(LVarA) - EVT_CASE_EQ(0) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, -11) - EVT_ADD(LVar1, 3) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_IF_FLAG(LVar3, STATUS_FLAG_DIZZY) - EVT_ADD(LVar0, -4) - EVT_ADD(LVar1, 36) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_IF_FLAG(LVar3, STATUS_FLAG_SLEEP) - EVT_ADD(LVar0, -8) - EVT_ADD(LVar1, 36) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_IF_EQ(LFlag0, FALSE) - EVT_ADD(LVar0, -28) - EVT_ADD(LVar1, 8) - EVT_END_IF - EVT_CASE_EQ(1) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, -4) - EVT_ADD(LVar1, 15) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_IF_FLAG(LVar3, STATUS_FLAG_DIZZY) - EVT_ADD(LVar0, -4) - EVT_ADD(LVar1, 36) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_IF_FLAG(LVar3, STATUS_FLAG_SLEEP) - EVT_ADD(LVar0, -8) - EVT_ADD(LVar1, 36) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_IF_EQ(LFlag0, FALSE) - EVT_ADD(LVar0, -10) - EVT_ADD(LVar1, 38) - EVT_END_IF - EVT_END_SWITCH - EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) - EVT_WAIT(20) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(spearStab) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim06) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, 10) - EVT_ELSE - EVT_ADD(LVar0, 25) - EVT_END_IF - EVT_SET(LVar1, 0) - EVT_ADD(LVar2, 1) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim04) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim1A) - EVT_WAIT(15) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_309) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim1B) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_WAIT(20) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) - EVT_EXEC_WAIT(N(80218D7C)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_309) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim1B) - EVT_WAIT(5) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_WAIT(20) - EVT_EXEC_WAIT(N(80218D7C)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(summonBackup) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 15) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_THREAD - EVT_WAIT(5) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FA) - EVT_WAIT(15) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FB) - EVT_END_THREAD - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim05) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim10) - EVT_WAIT(25) - EVT_THREAD - EVT_WAIT(5) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FA) - EVT_WAIT(15) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FB) - EVT_END_THREAD - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim05) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim10) - EVT_WAIT(30) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim05) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 15) - EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, LVar0, LVar1, LVar2, 30, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim0E) - EVT_WAIT(20) - EVT_CALL(GetOriginalActorType, ACTOR_SELF, LVar0) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_4 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar1, LVar2) - EVT_CALL(GetOriginalActorType, LVar1, LVar2) - EVT_IF_EQ(LVar0, LVar2) - EVT_CALL(SetAnimation, LVar1, 2, ANIM_SpearGuy_Anim04) - EVT_CALL(GetIndexFromHome, LVar1, LVar3) - EVT_IF_LT(LVarA, LVar3) - EVT_CALL(GetActorVar, LVar1, 0, LVar4) - EVT_IF_EQ(LVar4, 0) - EVT_CALL(SetActorVar, LVar1, 0, 1) - EVT_CALL(SetIdleAnimations, LVar1, 2, EVT_PTR(N(IdleAnimations_8021860C))) - EVT_CALL(SetPartEventFlags, LVar1, 2, 16) - EVT_CALL(SetAnimation, LVar1, 2, ANIM_SpearGuy_Anim03) - EVT_END_IF - EVT_END_IF - EVT_END_IF - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar1) - EVT_IF_NE(LVar1, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_SET(LFlag0, FALSE) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_4 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(1) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetIndexFromHome, LVar0, LVar1) - EVT_IF_LT(LVar1, LVarA) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(1) - EVT_END_IF - EVT_IF_EQ(LFlag0, FALSE) - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8021A8C0)), 0) - EVT_ELSE - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8021A8DC)), 0) - EVT_END_IF - EVT_SET(LVarB, LVar0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetAnimation, LVarB, 2, ANIM_SpearGuy_Anim10) - EVT_CALL(SetGoalToIndex, LVarB, LVarA) - EVT_CALL(GetGoalPos, LVarB, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 220) - EVT_CALL(SetActorPos, LVarB, LVar0, 0, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) - EVT_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FA) - EVT_WAIT(15) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FA) - EVT_WAIT(15) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FB) - EVT_WAIT(15) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FB) - EVT_WAIT(15) - EVT_END_THREAD - EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, LVarB, 0, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) - EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 15) - EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, LVar0, LVar1, LVar2, 30, 0) - EVT_CALL(SetAnimation, LVarB, 2, ANIM_SpearGuy_Anim0E) - EVT_WAIT(20) - EVT_IF_EQ(LFlag0, FALSE) - EVT_CALL(SetAnimation, LVarB, 2, ANIM_SpearGuy_Anim04) - EVT_ELSE - EVT_CALL(SetAnimation, LVarB, 2, ANIM_SpearGuy_Anim03) - EVT_END_IF - EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(HPBarToHome, LVarB) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, LVarB, 1, 1) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, LVarB, 1, 2) - EVT_END_SWITCH - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 3) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -Vec3i N(vector3D_8021A8B4) = { NPC_DISPOSE_LOCATION }; - -Formation N(specialFormation_8021A8C0) = { - ACTOR_BY_POS(NAMESPACE, N(vector3D_8021A8B4), 100, 0), -}; - -Formation N(specialFormation_8021A8DC) = { - ACTOR_BY_POS(NAMESPACE, N(vector3D_8021A8B4), 100, 1), -}; - -EvtScript N(becomeShyGuy) = { - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 2) - EVT_WAIT(10) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim13) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim18) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_ADD(LVar1, 15) - EVT_SUB(LVar2, 1) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_4, EVT_FLOAT(0.5)) - EVT_ADD(LVar0, 50) - EVT_SUB(LVar2, 30) - EVT_THREAD - EVT_LOOP(15) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_4, 0, 0, 10) - EVT_WAIT(1) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_4, 0, 0, -10) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) - EVT_THREAD - EVT_LOOP(10) - EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) - EVT_PLAY_EFFECT(EFFECT_SPARKLES, 3, LVar0, LVar1, LVar2, 5, 0) - EVT_WAIT(3) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_4, SOUND_2FC) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_4, ACTOR_SOUND_JUMP, 0, 0) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_4, LVar0, 0, LVar2, 30, TRUE) - EVT_WAIT(5) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET) - EVT_EXEC_WAIT(N(8021BF8C)) - EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_SHY_GUY) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_80218744))) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_RETURN - EVT_END -}; - -EvtScript N(spearThrow) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim06) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 200) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim15) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_SUB(LVar0, 100) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_SUB(LVar0, 70) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) - EVT_ELSE - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_END_IF - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim11) - EVT_WAIT(5) - EVT_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim17) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 10) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim12) - EVT_END_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, 20, LVar2) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, -30) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_THREAD - EVT_CALL(MakeLerp, -30, 45, 20, EASING_LINEAR) - EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF - EVT_END_THREAD - EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_3, SOUND_30A) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_3, ACTOR_SOUND_JUMP, 0, 0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_SET(LVar1, 10) - EVT_ADD(LVar2, 2) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_3, EVT_FLOAT(0.7)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2, 20, TRUE) - EVT_WAIT(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) - EVT_WAIT(30) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) - EVT_WAIT(10) - EVT_EXEC_WAIT(N(becomeShyGuy)) - EVT_CALL(YieldTurn) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim11) - EVT_WAIT(5) - EVT_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim17) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 10) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim12) - EVT_END_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, 20, LVar2) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, -30) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_THREAD - EVT_CALL(MakeLerp, -30, 45, 20, EASING_LINEAR) - EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF - EVT_END_THREAD - EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_3, SOUND_30A) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_3, ACTOR_SOUND_JUMP, 0, 0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar2, 2) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_3, EVT_FLOAT(0.7)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2, 20, TRUE) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_WAIT(3) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_WAIT(20) - EVT_EXEC_WAIT(N(becomeShyGuy)) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021B770) = { - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar5) - EVT_CALL(GetIndexFromHome, LVar0, LVar5) - EVT_MOD(LVar5, 4) - EVT_SWITCH(LVar5) - EVT_CASE_EQ(0) - EVT_SET(LFlag1, TRUE) - EVT_CASE_EQ(1) - EVT_SET(LFlag2, TRUE) - EVT_CASE_EQ(2) - EVT_SET(LFlag3, TRUE) - EVT_CASE_EQ(3) - EVT_SET(LFlag4, TRUE) - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_IF_EQ(LFlag1, FALSE) - EVT_SET(LVarA, 0) - EVT_RETURN - EVT_END_IF - EVT_IF_EQ(LFlag2, FALSE) - EVT_SET(LVarA, 1) - EVT_RETURN - EVT_END_IF - EVT_IF_EQ(LFlag3, FALSE) - EVT_SET(LVarA, 2) - EVT_RETURN - EVT_END_IF - EVT_IF_EQ(LFlag4, FALSE) - EVT_SET(LVarA, 3) - EVT_RETURN - EVT_END_IF - EVT_SET(LVarA, -1) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021B96C) = { - EVT_SET(LVar9, 0) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetOriginalActorType, LVar0, LVar2) - EVT_SWITCH(LVar2) - EVT_CASE_EQ(ACTOR_TYPE_JUNGLE_FUZZY) - EVT_CALL(GetStatusFlags, LVar0, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(GetActorVar, LVar0, 0, LVar3) - EVT_IF_NE(LVar3, 2) - EVT_ADD(LVar9, 1) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(ACTOR_TYPE_SPEAR_GUY) - EVT_CALL(GetStatusFlags, LVar0, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(GetActorVar, LVar0, 1, LVar3) - EVT_IF_LT(LVar3, 2) - EVT_ADD(LVar9, 1) - EVT_END_IF - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(8021BB18) = { - EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVarA) - EVT_SET(LFlag0, FALSE) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_4 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetIndexFromHome, LVar0, LVar1) - EVT_IF_LT(LVar1, LVarA) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET(LVar0, 1) - EVT_EXEC_WAIT(N(setSpearStance)) - EVT_END_IF - EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_SET(LVar0, 0) - EVT_EXEC_WAIT(N(setSpearStance)) - EVT_END_IF - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021BCB4) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_EXEC_WAIT(N(spearStab)) - EVT_EXEC_WAIT(N(8021BB18)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_EXEC_WAIT(N(8021B770)) - EVT_IF_EQ(LVarA, -1) - EVT_EXEC_WAIT(N(spearStab)) - EVT_EXEC_WAIT(N(8021BB18)) - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(8021B96C)) - EVT_SWITCH(LVar9) - EVT_CASE_EQ(1) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 300) - EVT_EXEC_WAIT(N(summonBackup)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(2) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 150) - EVT_EXEC_WAIT(N(summonBackup)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(3) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 100) - EVT_EXEC_WAIT(N(summonBackup)) - EVT_RETURN - EVT_END_IF - EVT_END_SWITCH - EVT_EXEC_WAIT(N(spearStab)) - EVT_EXEC_WAIT(N(8021BB18)) - EVT_END_CASE_GROUP - EVT_CASE_EQ(2) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(GetTargetListLength, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_EXEC_WAIT(N(spearThrow)) - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(spearStab)) - EVT_EXEC_WAIT(N(8021BB18)) - EVT_CASE_EQ(3) - EVT_EXEC_WAIT(N(spearThrow)) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -s32 N(IdleAnimations_8021BF40)[] = { - STATUS_KEY_NORMAL, ANIM_ShyGuy_Red_Anim01, - STATUS_KEY_STONE, ANIM_ShyGuy_Red_Anim00, - STATUS_KEY_SLEEP, ANIM_ShyGuy_Red_Anim12, - STATUS_KEY_POISON, ANIM_ShyGuy_Red_Anim01, - STATUS_KEY_STOP, ANIM_ShyGuy_Red_Anim00, - STATUS_KEY_STATIC, ANIM_ShyGuy_Red_Anim01, - STATUS_KEY_PARALYZE, ANIM_ShyGuy_Red_Anim00, - STATUS_KEY_DIZZY, ANIM_ShyGuy_Red_Anim13, - STATUS_KEY_FEAR, ANIM_ShyGuy_Red_Anim13, - STATUS_END, -}; - -EvtScript N(8021BF8C) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021D8D8))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021BFD8))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C14C))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_8021BFD8) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021C0E8) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021C14C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8021C0E8)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim14) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021C628) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_END_THREAD - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_WAIT(8) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(8021C0E8)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021CD50) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 80) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) - EVT_THREAD - EVT_WAIT(12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) - EVT_THREAD - EVT_WAIT(9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(20) - EVT_SUB(LVar3, 30) - EVT_IF_LT(LVar3, 0) - EVT_ADD(LVar3, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim07) - EVT_WAIT(15) - EVT_GOTO(2) - EVT_LABEL(1) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim10) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 50) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim11) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim13) - EVT_END_IF - EVT_WAIT(25) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_LABEL(2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021D8D8) = { - EVT_CALL(RandInt, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_EXEC_WAIT(N(8021C628)) - EVT_ELSE - EVT_EXEC_WAIT(N(8021CD50)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/spear_guy.inc.c" diff --git a/src/battle/area/jan/actor/spike_top.c b/src/battle/area/jan/actor/spike_top.c index 038bf2d32e..42d2c32d85 100644 --- a/src/battle/area/jan/actor/spike_top.c +++ b/src/battle/area/jan/actor/spike_top.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_jan_spike_top +#include "../area.h" #include "battle/common/actor/spike_top.inc.c" diff --git a/src/battle/area/jan/area.c b/src/battle/area/jan/area.c index e3866c80de..813d08c07b 100644 --- a/src/battle/area/jan/area.c +++ b/src/battle/area/jan/area.c @@ -1,154 +1,151 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_jan +extern ActorBlueprint A(spear_guy); +extern ActorBlueprint A(jungle_fuzzy); +extern ActorBlueprint A(medi_guy); +extern ActorBlueprint A(spike_top); +extern ActorBlueprint A(hurt_plant); +extern ActorBlueprint A(m_bush); -extern ActorBlueprint N(spear_guy); -extern ActorBlueprint N(jungle_fuzzy); -extern ActorBlueprint N(medi_guy); -extern ActorBlueprint N(spike_top); -extern ActorBlueprint N(hurt_plant); -extern ActorBlueprint N(m_bush); +extern Stage A(jan_00); +extern Stage A(jan_01); +extern Stage A(jan_01b); +extern Stage A(jan_02); +extern Stage A(jan_03); +extern Stage A(jan_03b); +extern Stage A(jan_04); +extern Stage A(jan_04b); -extern Stage N(jan_00); -extern Stage N(jan_01); -extern Stage N(jan_01b); -extern Stage N(jan_02); -extern Stage N(jan_03); -extern Stage N(jan_03b); -extern Stage N(jan_04); -extern Stage N(jan_04b); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_B, 10, 0), - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_C, 9, 1), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_B, 10, 0), + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_C, 9, 1), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_A, 10, 0), - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_B, 9, 1), - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_C, 8, 1), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_A, 10, 0), + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_B, 9, 1), + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_C, 8, 1), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_B, 10, 0), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_C, 9), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_B, 10, 0), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_A, 10, 0), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_D, 7), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_A, 10, 0), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_A, 10, 0), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_C, 8), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_A, 10, 0), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_A, 10, 0), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_C, 8, 1), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_A, 10, 0), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_C, 8, 1), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_A, 10, 0), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_C, 8, 1), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_D, 7), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_A, 10, 0), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_C, 8, 1), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_A, 10, 0), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_C, 8), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_A, 10, 0), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(hurt_plant), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(hurt_plant), BTL_POS_GROUND_C, 10), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(hurt_plant), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(hurt_plant), BTL_POS_GROUND_C, 10), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(hurt_plant), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hurt_plant), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hurt_plant), BTL_POS_GROUND_C, 8), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(hurt_plant), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hurt_plant), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hurt_plant), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_C, 9), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_C, 8), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_D, 7), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spear_guy), BTL_POS_GROUND_B, 9, 1), - ACTOR_BY_IDX(N(jungle_fuzzy), BTL_POS_GROUND_C, 8), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spear_guy), BTL_POS_GROUND_B, 9, 1), + ACTOR_BY_IDX(A(jungle_fuzzy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(m_bush), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(m_bush), BTL_POS_GROUND_C, 9), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(m_bush), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(m_bush), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(m_bush), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(m_bush), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(m_bush), BTL_POS_GROUND_C, 8), +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(m_bush), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(m_bush), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(m_bush), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(m_bush), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(m_bush), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(m_bush), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(m_bush), BTL_POS_GROUND_D, 7), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(m_bush), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(m_bush), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(m_bush), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(m_bush), BTL_POS_GROUND_D, 7), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(jan_01), "ヤリダンサーx2"), - BATTLE(N(Formation_01), N(jan_01), "ヤリダンサーx3"), - BATTLE(N(Formation_02), N(jan_01), "ヤリダンサー,トロピカル"), - BATTLE(N(Formation_03), N(jan_01), "ヤリダンサー,トロピカルx3"), - BATTLE(N(Formation_04), N(jan_01), "ヤリダンサー,トロピカルx2"), - BATTLE(N(Formation_05), N(jan_01), "ヤリダンサー,トロピカル,ヤリダンサー"), - BATTLE(N(Formation_06), N(jan_01), "ヤリダンサー,トロピカル,ヤリダンサー,トロピカル"), - BATTLE(N(Formation_07), N(jan_01), "ヤリダンサー,かいふくヘイホー,トゲメット"), - BATTLE(N(Formation_08), N(jan_01), "ピロリンそうだましx2"), - BATTLE(N(Formation_09), N(jan_01), "ピロリンそうだましx3"), - BATTLE(N(Formation_0A), N(jan_01), "トロピカルx2"), - BATTLE(N(Formation_0B), N(jan_01), "トロピカルx3"), - BATTLE(N(Formation_0C), N(jan_01), "トロピカルx4"), - BATTLE(N(Formation_0D), N(jan_01), "トロピカル,ヤリダンサー,トロピカル"), - BATTLE(N(Formation_0E), N(jan_01), "ぎたいそうx2"), - BATTLE(N(Formation_0F), N(jan_01), "ぎたいそうx3"), - BATTLE(N(Formation_10), N(jan_01), "ぎたいそうx4"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(jan_01), "ヤリダンサーx2"), + BATTLE(A(Formation_01), A(jan_01), "ヤリダンサーx3"), + BATTLE(A(Formation_02), A(jan_01), "ヤリダンサー,トロピカル"), + BATTLE(A(Formation_03), A(jan_01), "ヤリダンサー,トロピカルx3"), + BATTLE(A(Formation_04), A(jan_01), "ヤリダンサー,トロピカルx2"), + BATTLE(A(Formation_05), A(jan_01), "ヤリダンサー,トロピカル,ヤリダンサー"), + BATTLE(A(Formation_06), A(jan_01), "ヤリダンサー,トロピカル,ヤリダンサー,トロピカル"), + BATTLE(A(Formation_07), A(jan_01), "ヤリダンサー,かいふくヘイホー,トゲメット"), + BATTLE(A(Formation_08), A(jan_01), "ピロリンそうだましx2"), + BATTLE(A(Formation_09), A(jan_01), "ピロリンそうだましx3"), + BATTLE(A(Formation_0A), A(jan_01), "トロピカルx2"), + BATTLE(A(Formation_0B), A(jan_01), "トロピカルx3"), + BATTLE(A(Formation_0C), A(jan_01), "トロピカルx4"), + BATTLE(A(Formation_0D), A(jan_01), "トロピカル,ヤリダンサー,トロピカル"), + BATTLE(A(Formation_0E), A(jan_01), "ぎたいそうx2"), + BATTLE(A(Formation_0F), A(jan_01), "ぎたいそうx3"), + BATTLE(A(Formation_10), A(jan_01), "ぎたいそうx4"), {}, }; -StageList N(Stages) = { - STAGE("jan_00", N(jan_00)), - STAGE("jan_01", N(jan_01)), - STAGE("jan_01b", N(jan_01b)), - STAGE("jan_02", N(jan_02)), - STAGE("jan_03", N(jan_03)), - STAGE("jan_03b", N(jan_03b)), - STAGE("jan_04", N(jan_04)), - STAGE("jan_04b", N(jan_04b)), +StageList A(Stages) = { + STAGE("jan_00", A(jan_00)), + STAGE("jan_01", A(jan_01)), + STAGE("jan_01b", A(jan_01b)), + STAGE("jan_02", A(jan_02)), + STAGE("jan_03", A(jan_03)), + STAGE("jan_03b", A(jan_03b)), + STAGE("jan_04", A(jan_04)), + STAGE("jan_04b", A(jan_04b)), {}, }; diff --git a/src/battle/area/jan/area.h b/src/battle/area/jan/area.h new file mode 100644 index 0000000000..f39269fc75 --- /dev/null +++ b/src/battle/area/jan/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_jan diff --git a/src/battle/area/jan/stage/jan_00.c b/src/battle/area/jan/stage/jan_00.c index 16787dd4d2..632d501a82 100644 --- a/src/battle/area/jan/stage/jan_00.c +++ b/src/battle/area/jan/stage/jan_00.c @@ -1,7 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/jan_bt00_shape.h" +#include "../area.h" -#define NAMESPACE b_area_jan_jan_00 - -#include "battle/common/stage/jan_00.inc.c" +#include "battle/common/stage/area_jan/jan_00.inc.c" diff --git a/src/battle/area/jan/stage/jan_01.c b/src/battle/area/jan/stage/jan_01.c index a51db03466..8778d5561b 100644 --- a/src/battle/area/jan/stage/jan_01.c +++ b/src/battle/area/jan/stage/jan_01.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan_jan_01 - -#include "battle/common/stage/jan_01.inc.c" +#include "battle/common/stage/area_jan/jan_01.inc.c" diff --git a/src/battle/area/jan/stage/jan_01b.c b/src/battle/area/jan/stage/jan_01b.c index 563314be06..c91c39cde4 100644 --- a/src/battle/area/jan/stage/jan_01b.c +++ b/src/battle/area/jan/stage/jan_01b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan_jan_01b - -#include "battle/common/stage/jan_01b.inc.c" +#include "battle/common/stage/area_jan/jan_01b.inc.c" diff --git a/src/battle/area/jan/stage/jan_02.c b/src/battle/area/jan/stage/jan_02.c index cc1591b5df..44ac7f8a0a 100644 --- a/src/battle/area/jan/stage/jan_02.c +++ b/src/battle/area/jan/stage/jan_02.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan_jan_02 - -#include "battle/common/stage/jan_02.inc.c" +#include "battle/common/stage/area_jan/jan_02.inc.c" diff --git a/src/battle/area/jan/stage/jan_03.c b/src/battle/area/jan/stage/jan_03.c index d0d557c8ea..2699a3f68f 100644 --- a/src/battle/area/jan/stage/jan_03.c +++ b/src/battle/area/jan/stage/jan_03.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan_jan_03 - -#include "battle/common/stage/jan_03.inc.c" +#include "battle/common/stage/area_jan/jan_03.inc.c" diff --git a/src/battle/area/jan/stage/jan_03b.c b/src/battle/area/jan/stage/jan_03b.c index 3d41352469..610f8ec5be 100644 --- a/src/battle/area/jan/stage/jan_03b.c +++ b/src/battle/area/jan/stage/jan_03b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan_jan_03b - -#include "battle/common/stage/jan_03b.inc.c" +#include "battle/common/stage/area_jan/jan_03b.inc.c" diff --git a/src/battle/area/jan/stage/jan_04.c b/src/battle/area/jan/stage/jan_04.c index 683da04306..62e9883493 100644 --- a/src/battle/area/jan/stage/jan_04.c +++ b/src/battle/area/jan/stage/jan_04.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan_jan_04 - -#include "battle/common/stage/jan_04.inc.c" +#include "battle/common/stage/area_jan/jan_04.inc.c" diff --git a/src/battle/area/jan/stage/jan_04b.c b/src/battle/area/jan/stage/jan_04b.c index 8094656c9f..221aad20e7 100644 --- a/src/battle/area/jan/stage/jan_04b.c +++ b/src/battle/area/jan/stage/jan_04b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan_jan_04b - -#include "battle/common/stage/jan_04b.inc.c" +#include "battle/common/stage/area_jan/jan_04b.inc.c" diff --git a/src/battle/area/jan2/actor/putrid_piranha.c b/src/battle/area/jan2/actor/putrid_piranha.c index a289c9e03e..8406585863 100644 --- a/src/battle/area/jan2/actor/putrid_piranha.c +++ b/src/battle/area/jan2/actor/putrid_piranha.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_jan2_putrid_piranha +#include "../area.h" #include "battle/common/actor/putrid_piranha.inc.c" diff --git a/src/battle/area/jan2/actor/white_magikoopa.c b/src/battle/area/jan2/actor/white_magikoopa.c index 6ea0ccc550..8e56b247f1 100644 --- a/src/battle/area/jan2/actor/white_magikoopa.c +++ b/src/battle/area/jan2/actor/white_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_jan2_white_magikoopa +#include "../area.h" #include "battle/common/actor/white_magikoopa.inc.c" diff --git a/src/battle/area/jan2/area.c b/src/battle/area/jan2/area.c index 56a9347602..6eb51b02aa 100644 --- a/src/battle/area/jan2/area.c +++ b/src/battle/area/jan2/area.c @@ -1,58 +1,55 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_jan2 +extern ActorBlueprint A(putrid_piranha); +extern ActorBlueprint A(white_magikoopa); -extern ActorBlueprint N(putrid_piranha); -extern ActorBlueprint N(white_magikoopa); +extern Stage A(jan_00); +extern Stage A(jan_01); +extern Stage A(jan_01b); +extern Stage A(jan_02); +extern Stage A(jan_03); +extern Stage A(jan_03b); +extern Stage A(jan_04); +extern Stage A(jan_04b); -extern Stage N(jan_00); -extern Stage N(jan_01); -extern Stage N(jan_01b); -extern Stage N(jan_02); -extern Stage N(jan_03); -extern Stage N(jan_03b); -extern Stage N(jan_04); -extern Stage N(jan_04b); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_B, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 8), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(white_magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(white_magikoopa), BTL_POS_GROUND_D, 7), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(jan_01), "ポイズンパックン"), - BATTLE(N(Formation_01), N(jan_01), "ポイズンパックンx2"), - BATTLE(N(Formation_02), N(jan_01), "ポイズンパックンx3"), - BATTLE(N(Formation_03), N(jan_01), "ポイズンパックンx3,ホワイトカメック"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(jan_01), "ポイズンパックン"), + BATTLE(A(Formation_01), A(jan_01), "ポイズンパックンx2"), + BATTLE(A(Formation_02), A(jan_01), "ポイズンパックンx3"), + BATTLE(A(Formation_03), A(jan_01), "ポイズンパックンx3,ホワイトカメック"), {}, }; -StageList N(Stages) = { - STAGE("jan_00", N(jan_00)), - STAGE("jan_01", N(jan_01)), - STAGE("jan_01b", N(jan_01b)), - STAGE("jan_02", N(jan_02)), - STAGE("jan_03", N(jan_03)), - STAGE("jan_03b", N(jan_03b)), - STAGE("jan_04", N(jan_04)), - STAGE("jan_04b", N(jan_04b)), +StageList A(Stages) = { + STAGE("jan_00", A(jan_00)), + STAGE("jan_01", A(jan_01)), + STAGE("jan_01b", A(jan_01b)), + STAGE("jan_02", A(jan_02)), + STAGE("jan_03", A(jan_03)), + STAGE("jan_03b", A(jan_03b)), + STAGE("jan_04", A(jan_04)), + STAGE("jan_04b", A(jan_04b)), {}, }; diff --git a/src/battle/area/jan2/area.h b/src/battle/area/jan2/area.h new file mode 100644 index 0000000000..1a815db58b --- /dev/null +++ b/src/battle/area/jan2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_jan2 diff --git a/src/battle/area/jan2/stage/jan_00.c b/src/battle/area/jan2/stage/jan_00.c index 005872d37d..632d501a82 100644 --- a/src/battle/area/jan2/stage/jan_00.c +++ b/src/battle/area/jan2/stage/jan_00.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan2_jan_00 - -#include "battle/common/stage/jan_00.inc.c" +#include "battle/common/stage/area_jan/jan_00.inc.c" diff --git a/src/battle/area/jan2/stage/jan_01.c b/src/battle/area/jan2/stage/jan_01.c index ff7c26148e..8778d5561b 100644 --- a/src/battle/area/jan2/stage/jan_01.c +++ b/src/battle/area/jan2/stage/jan_01.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan2_jan_01 - -#include "battle/common/stage/jan_01.inc.c" +#include "battle/common/stage/area_jan/jan_01.inc.c" diff --git a/src/battle/area/jan2/stage/jan_01b.c b/src/battle/area/jan2/stage/jan_01b.c index 11c32a3c56..c91c39cde4 100644 --- a/src/battle/area/jan2/stage/jan_01b.c +++ b/src/battle/area/jan2/stage/jan_01b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan2_jan_01b - -#include "battle/common/stage/jan_01b.inc.c" +#include "battle/common/stage/area_jan/jan_01b.inc.c" diff --git a/src/battle/area/jan2/stage/jan_02.c b/src/battle/area/jan2/stage/jan_02.c index 26cde47abf..44ac7f8a0a 100644 --- a/src/battle/area/jan2/stage/jan_02.c +++ b/src/battle/area/jan2/stage/jan_02.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan2_jan_02 - -#include "battle/common/stage/jan_02.inc.c" +#include "battle/common/stage/area_jan/jan_02.inc.c" diff --git a/src/battle/area/jan2/stage/jan_03.c b/src/battle/area/jan2/stage/jan_03.c index bc8aedbc15..2699a3f68f 100644 --- a/src/battle/area/jan2/stage/jan_03.c +++ b/src/battle/area/jan2/stage/jan_03.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan2_jan_03 - -#include "battle/common/stage/jan_03.inc.c" +#include "battle/common/stage/area_jan/jan_03.inc.c" diff --git a/src/battle/area/jan2/stage/jan_03b.c b/src/battle/area/jan2/stage/jan_03b.c index 16b68081b4..610f8ec5be 100644 --- a/src/battle/area/jan2/stage/jan_03b.c +++ b/src/battle/area/jan2/stage/jan_03b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan2_jan_03b - -#include "battle/common/stage/jan_03b.inc.c" +#include "battle/common/stage/area_jan/jan_03b.inc.c" diff --git a/src/battle/area/jan2/stage/jan_04.c b/src/battle/area/jan2/stage/jan_04.c index 8430f254ab..62e9883493 100644 --- a/src/battle/area/jan2/stage/jan_04.c +++ b/src/battle/area/jan2/stage/jan_04.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan2_jan_04 - -#include "battle/common/stage/jan_04.inc.c" +#include "battle/common/stage/area_jan/jan_04.inc.c" diff --git a/src/battle/area/jan2/stage/jan_04b.c b/src/battle/area/jan2/stage/jan_04b.c index a2ed18b914..221aad20e7 100644 --- a/src/battle/area/jan2/stage/jan_04b.c +++ b/src/battle/area/jan2/stage/jan_04b.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_jan2_jan_04b - -#include "battle/common/stage/jan_04b.inc.c" +#include "battle/common/stage/area_jan/jan_04b.inc.c" diff --git a/src/battle/area/kgr/actor/fuzzipede.c b/src/battle/area/kgr/actor/fuzzipede.c index 508449174b..331714d9a5 100644 --- a/src/battle/area/kgr/actor/fuzzipede.c +++ b/src/battle/area/kgr/actor/fuzzipede.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/Fuzzipede.h" -#define NAMESPACE b_area_kgr_fuzzipede +#define NAMESPACE A(fuzzipede) extern EvtScript N(init_80218B70); extern EvtScript N(takeTurn_8021C1A4); @@ -319,74 +316,74 @@ EvtScript N(handleEvent_802197FC) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1E) EVT_SET_CONST(LVar2, ANIM_Fuzzipede_Anim1F) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1E) EVT_SET_CONST(LVar2, ANIM_Fuzzipede_Anim1F) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1F) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim08) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(80219668)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim04) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SWAP_PARTNER) @@ -437,62 +434,62 @@ EvtScript N(handleEvent_80219ED4) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1C) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1C) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(80219D68)) EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim20) EVT_SET_CONST(LVar2, ANIM_Fuzzipede_Anim21) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(80219D68)) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim20) EVT_SET_CONST(LVar2, ANIM_Fuzzipede_Anim21) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim21) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim08) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(80219668)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim06) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1C) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzipede_Anim1C) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN diff --git a/src/battle/area/kgr/area.c b/src/battle/area/kgr/area.c index 2d2d76796f..b0c14fc73e 100644 --- a/src/battle/area/kgr/area.c +++ b/src/battle/area/kgr/area.c @@ -1,22 +1,19 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_kgr +extern ActorBlueprint A(fuzzipede); -extern ActorBlueprint N(fuzzipede); +extern Stage A(kgr_01); -extern Stage N(kgr_01); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(fuzzipede), BTL_POS_GROUND_C, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(fuzzipede), BTL_POS_GROUND_C, 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kgr_01), "ケムシ"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kgr_01), "ケムシ"), {}, }; -StageList N(Stages) = { - STAGE("kgr_01", N(kgr_01)), +StageList A(Stages) = { + STAGE("kgr_01", A(kgr_01)), {}, }; diff --git a/src/battle/area/kgr/area.h b/src/battle/area/kgr/area.h new file mode 100644 index 0000000000..f66a2856c2 --- /dev/null +++ b/src/battle/area/kgr/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kgr diff --git a/src/battle/area/kgr/stage/kgr_01.c b/src/battle/area/kgr/stage/kgr_01.c index cf807cbd9c..097c5adac3 100644 --- a/src/battle/area/kgr/stage/kgr_01.c +++ b/src/battle/area/kgr/stage/kgr_01.c @@ -1,67 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kgr_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kgr_kgr_01 - -#include "battle/common/stage/lib/WaterEffects.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SET(LVar0, MODEL_bin1) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_WAIT(4) - EVT_SET(LVar0, MODEL_bin2) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_WAIT(4) - EVT_SET(LVar0, MODEL_bin3) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_WAIT(4) - EVT_SET(LVar0, MODEL_bin4) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_END_THREAD - EVT_THREAD - EVT_SET(LVar0, MODEL_hako1) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_WAIT(4) - EVT_SET(LVar0, MODEL_hako2) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_WAIT(4) - EVT_SET(LVar0, MODEL_hako4) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_WAIT(4) - EVT_SET(LVar0, MODEL_hako5) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_WAIT(4) - EVT_SET(LVar0, MODEL_hako6) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_END_THREAD - EVT_SET(LVar0, MODEL_fune2) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_SET(LVar0, MODEL_fune1) - EVT_EXEC(N(EVS_AnimateFlotsam)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_hone, - MODEL_hako4, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kgr_tex", - .shape = "kgr_bt01_shape", - .hit = "kgr_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kgr/kgr_01.inc.c" diff --git a/src/battle/area/kkj/actor/kammy_koopa.c b/src/battle/area/kkj/actor/kammy_koopa.c index 8864ac9e07..6f9e3bbdc5 100644 --- a/src/battle/area/kkj/actor/kammy_koopa.c +++ b/src/battle/area/kkj/actor/kammy_koopa.c @@ -1,13 +1,10 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" +#include "entity.h" #include "sprite/npc/BattleKammy.h" #include "sprite/npc/Twink.h" #include "sprite/npc/BattleParakarry.h" -#include "entity.h" -#define NAMESPACE b_area_kkj_kammy_koopa +#define NAMESPACE A(kammy_koopa) extern EvtScript N(init); extern EvtScript N(idle); @@ -152,20 +149,20 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKammy_Anim0D) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(speakOnHit)) EVT_END_CASE_GROUP EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKammy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_EXEC_WAIT(N(speakOnHit)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKammy_Anim0D) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) diff --git a/src/battle/area/kkj/area.c b/src/battle/area/kkj/area.c index 85c71d98fb..42b254e001 100644 --- a/src/battle/area/kkj/area.c +++ b/src/battle/area/kkj/area.c @@ -1,22 +1,19 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_kkj +extern ActorBlueprint A(kammy_koopa); -extern ActorBlueprint N(kammy_koopa); +extern Stage A(kkj_02); -extern Stage N(kpa_05); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(kammy_koopa), BTL_POS_AIR_C, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(kammy_koopa), BTL_POS_AIR_C, 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kpa_05), "カメックばば(ピーチ、ティンクせん)"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kkj_02), "カメックばば(ピーチ、ティンクせん)"), {}, }; -StageList N(Stages) = { - STAGE("kpa_05", N(kpa_05)), +StageList A(Stages) = { + STAGE("kpa_05", A(kkj_02)), {}, }; diff --git a/src/battle/area/kkj/area.h b/src/battle/area/kkj/area.h new file mode 100644 index 0000000000..09d32ee68d --- /dev/null +++ b/src/battle/area/kkj/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kkj diff --git a/src/battle/area/kkj/stage/kpa_05.c b/src/battle/area/kkj/stage/kpa_05.c index 372a440168..20e2d08114 100644 --- a/src/battle/area/kkj/stage/kpa_05.c +++ b/src/battle/area/kkj/stage/kpa_05.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kkj_kpa_05 - -#include "battle/common/stage/kkj_02.inc.c" +#include "battle/common/stage/area_kkj/kkj_02.inc.c" diff --git a/src/battle/area/kmr_part_1/actor/goomba.c b/src/battle/area/kmr_part_1/actor/goomba.c index efd2283f89..7827ad425b 100644 --- a/src/battle/area/kmr_part_1/actor/goomba.c +++ b/src/battle/area/kmr_part_1/actor/goomba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kmr_part_1_goomba +#include "../area.h" #include "battle/common/actor/goomba.inc.c" diff --git a/src/battle/area/kmr_part_1/actor/paragoomba.c b/src/battle/area/kmr_part_1/actor/paragoomba.c index 7c52257487..2d2fefd360 100644 --- a/src/battle/area/kmr_part_1/actor/paragoomba.c +++ b/src/battle/area/kmr_part_1/actor/paragoomba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kmr_part_1_paragoomba +#include "../area.h" #include "battle/common/actor/paragoomba.inc.c" diff --git a/src/battle/area/kmr_part_1/actor/spiked_goomba.c b/src/battle/area/kmr_part_1/actor/spiked_goomba.c index 394491253f..50037b0556 100644 --- a/src/battle/area/kmr_part_1/actor/spiked_goomba.c +++ b/src/battle/area/kmr_part_1/actor/spiked_goomba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kmr_part_1_spiked_goomba +#include "../area.h" #include "battle/common/actor/spiked_goomba.inc.c" diff --git a/src/battle/area/kmr_part_1/area.c b/src/battle/area/kmr_part_1/area.c index a22ecbb06b..f176ddb9a6 100644 --- a/src/battle/area/kmr_part_1/area.c +++ b/src/battle/area/kmr_part_1/area.c @@ -1,102 +1,99 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_kmr_part_1 +extern ActorBlueprint A(goomba); +extern ActorBlueprint A(paragoomba); +extern ActorBlueprint A(spiked_goomba); -extern ActorBlueprint N(goomba); -extern ActorBlueprint N(paragoomba); -extern ActorBlueprint N(spiked_goomba); +extern Stage A(kmr_02); +extern Stage A(kmr_03); +extern Stage A(kmr_04); +extern Stage A(kmr_05); +extern Stage A(kmr_06); -extern Stage N(kmr_02); -extern Stage N(kmr_03); -extern Stage N(kmr_04); -extern Stage N(kmr_05); -extern Stage N(kmr_06); - -Formation N(Formation_00) = { - { &N(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, +Formation A(Formation_00) = { + { &A(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, }; -Formation N(Formation_01) = { - { &N(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, - { &N(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 9 }, +Formation A(Formation_01) = { + { &A(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, + { &A(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 9 }, }; -Formation N(Formation_02) = { - { &N(goomba), .home = { .index = BTL_POS_GROUND_A }, .priority = 10 }, - { &N(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 9 }, - { &N(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 8 }, +Formation A(Formation_02) = { + { &A(goomba), .home = { .index = BTL_POS_GROUND_A }, .priority = 10 }, + { &A(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 9 }, + { &A(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 8 }, }; -Formation N(Formation_03) = { - { &N(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, - { &N(paragoomba), .home = { .index = BTL_POS_AIR_C }, .priority = 9 }, +Formation A(Formation_03) = { + { &A(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, + { &A(paragoomba), .home = { .index = BTL_POS_AIR_C }, .priority = 9 }, }; -Formation N(Formation_04) = { - { &N(goomba), .home = { .index = BTL_POS_GROUND_A }, .priority = 10 }, - { &N(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 9 }, - { &N(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 8 }, - { &N(goomba), .home = { .index = BTL_POS_GROUND_D }, .priority = 7 }, +Formation A(Formation_04) = { + { &A(goomba), .home = { .index = BTL_POS_GROUND_A }, .priority = 10 }, + { &A(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 9 }, + { &A(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 8 }, + { &A(goomba), .home = { .index = BTL_POS_GROUND_D }, .priority = 7 }, }; -Formation N(Formation_05) = { - { &N(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, - { &N(spiked_goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 9 }, +Formation A(Formation_05) = { + { &A(goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, + { &A(spiked_goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 9 }, }; -Formation N(Formation_06) = { - { &N(goomba), .home = { .index = BTL_POS_GROUND_A }, .priority = 10 }, - { &N(paragoomba), .home = { .index = BTL_POS_AIR_B }, .priority = 9 }, - { &N(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 8 }, - { &N(paragoomba), .home = { .index = BTL_POS_AIR_D }, .priority = 7 }, +Formation A(Formation_06) = { + { &A(goomba), .home = { .index = BTL_POS_GROUND_A }, .priority = 10 }, + { &A(paragoomba), .home = { .index = BTL_POS_AIR_B }, .priority = 9 }, + { &A(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 8 }, + { &A(paragoomba), .home = { .index = BTL_POS_AIR_D }, .priority = 7 }, }; -Formation N(Formation_07) = { - { &N(paragoomba), .home = { .index = BTL_POS_AIR_B }, .priority = 10 }, +Formation A(Formation_07) = { + { &A(paragoomba), .home = { .index = BTL_POS_AIR_B }, .priority = 10 }, }; -Formation N(Formation_08) = { - { &N(paragoomba), .home = { .index = BTL_POS_AIR_B }, .priority = 10 }, - { &N(paragoomba), .home = { .index = BTL_POS_AIR_C }, .priority = 9 }, +Formation A(Formation_08) = { + { &A(paragoomba), .home = { .index = BTL_POS_AIR_B }, .priority = 10 }, + { &A(paragoomba), .home = { .index = BTL_POS_AIR_C }, .priority = 9 }, }; -Formation N(Formation_09) = { - { &N(paragoomba), .home = { .index = BTL_POS_AIR_A }, .priority = 10 }, - { &N(paragoomba), .home = { .index = BTL_POS_AIR_B }, .priority = 9 }, - { &N(paragoomba), .home = { .index = BTL_POS_AIR_C }, .priority = 8 }, +Formation A(Formation_09) = { + { &A(paragoomba), .home = { .index = BTL_POS_AIR_A }, .priority = 10 }, + { &A(paragoomba), .home = { .index = BTL_POS_AIR_B }, .priority = 9 }, + { &A(paragoomba), .home = { .index = BTL_POS_AIR_C }, .priority = 8 }, }; -Formation N(Formation_0A) = { - { &N(spiked_goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, +Formation A(Formation_0A) = { + { &A(spiked_goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, }; -Formation N(Formation_0B) = { - { &N(spiked_goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, - { &N(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 9 }, +Formation A(Formation_0B) = { + { &A(spiked_goomba), .home = { .index = BTL_POS_GROUND_B }, .priority = 10 }, + { &A(goomba), .home = { .index = BTL_POS_GROUND_C }, .priority = 9 }, }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kmr_04), "クリボー"), - BATTLE(N(Formation_01), N(kmr_04), "クリボーx2"), - BATTLE(N(Formation_02), N(kmr_04), "クリボーx3"), - BATTLE(N(Formation_03), N(kmr_04), "クリボー、パタクリボー"), - BATTLE(N(Formation_04), N(kmr_04), "クリボーx4"), - BATTLE(N(Formation_05), N(kmr_04), "クリボー,トゲクリボー"), - BATTLE(N(Formation_06), N(kmr_04), "クリボー,パタクリボー,クリボー,パタクリボー"), - BATTLE(N(Formation_07), N(kmr_04), "パタクリボー"), - BATTLE(N(Formation_08), N(kmr_04), "パタクリボーx2"), - BATTLE(N(Formation_09), N(kmr_04), "パタクリボーx3"), - BATTLE(N(Formation_0A), N(kmr_04), "トゲクリボー"), - BATTLE(N(Formation_0B), N(kmr_04), "トゲクリボー、クリボー"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kmr_04), "クリボー"), + BATTLE(A(Formation_01), A(kmr_04), "クリボーx2"), + BATTLE(A(Formation_02), A(kmr_04), "クリボーx3"), + BATTLE(A(Formation_03), A(kmr_04), "クリボー、パタクリボー"), + BATTLE(A(Formation_04), A(kmr_04), "クリボーx4"), + BATTLE(A(Formation_05), A(kmr_04), "クリボー,トゲクリボー"), + BATTLE(A(Formation_06), A(kmr_04), "クリボー,パタクリボー,クリボー,パタクリボー"), + BATTLE(A(Formation_07), A(kmr_04), "パタクリボー"), + BATTLE(A(Formation_08), A(kmr_04), "パタクリボーx2"), + BATTLE(A(Formation_09), A(kmr_04), "パタクリボーx3"), + BATTLE(A(Formation_0A), A(kmr_04), "トゲクリボー"), + BATTLE(A(Formation_0B), A(kmr_04), "トゲクリボー、クリボー"), {}, }; -StageList N(Stages) = { - STAGE("kmr_02", N(kmr_02)), - STAGE("kmr_03", N(kmr_03)), - STAGE("kmr_04", N(kmr_04)), - STAGE("kmr_05", N(kmr_05)), - STAGE("kmr_06", N(kmr_06)), +StageList A(Stages) = { + STAGE("kmr_02", A(kmr_02)), + STAGE("kmr_03", A(kmr_03)), + STAGE("kmr_04", A(kmr_04)), + STAGE("kmr_05", A(kmr_05)), + STAGE("kmr_06", A(kmr_06)), {}, }; diff --git a/src/battle/area/kmr_part_1/area.h b/src/battle/area/kmr_part_1/area.h new file mode 100644 index 0000000000..927198969f --- /dev/null +++ b/src/battle/area/kmr_part_1/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kmr_part_1 diff --git a/src/battle/area/kmr_part_1/stage/kmr_02.c b/src/battle/area/kmr_part_1/stage/kmr_02.c index 8a719e0504..77d9023a8f 100644 --- a/src/battle/area/kmr_part_1/stage/kmr_02.c +++ b/src/battle/area/kmr_part_1/stage/kmr_02.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_1_kmr_02 - -#include "battle/common/stage/kmr_02.inc.c" +#include "battle/common/stage/area_kmr/kmr_02.inc.c" diff --git a/src/battle/area/kmr_part_1/stage/kmr_03.c b/src/battle/area/kmr_part_1/stage/kmr_03.c index 60f4a25464..db0b568e9b 100644 --- a/src/battle/area/kmr_part_1/stage/kmr_03.c +++ b/src/battle/area/kmr_part_1/stage/kmr_03.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_1_kmr_03 - -#include "battle/common/stage/kmr_03.inc.c" +#include "battle/common/stage/area_kmr/kmr_03.inc.c" diff --git a/src/battle/area/kmr_part_1/stage/kmr_04.c b/src/battle/area/kmr_part_1/stage/kmr_04.c index b645ba5a36..1d0ffbaa59 100644 --- a/src/battle/area/kmr_part_1/stage/kmr_04.c +++ b/src/battle/area/kmr_part_1/stage/kmr_04.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_1_kmr_04 - -#include "battle/common/stage/kmr_04.inc.c" +#include "battle/common/stage/area_kmr/kmr_04.inc.c" diff --git a/src/battle/area/kmr_part_1/stage/kmr_05.c b/src/battle/area/kmr_part_1/stage/kmr_05.c index b49f16bea8..04314f7f60 100644 --- a/src/battle/area/kmr_part_1/stage/kmr_05.c +++ b/src/battle/area/kmr_part_1/stage/kmr_05.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_1_kmr_05 - -#include "battle/common/stage/kmr_05.inc.c" +#include "battle/common/stage/area_kmr/kmr_05.inc.c" diff --git a/src/battle/area/kmr_part_1/stage/kmr_06.c b/src/battle/area/kmr_part_1/stage/kmr_06.c index f1cf9bfed7..91f587accc 100644 --- a/src/battle/area/kmr_part_1/stage/kmr_06.c +++ b/src/battle/area/kmr_part_1/stage/kmr_06.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_1_kmr_06 - -#include "battle/common/stage/kmr_06.inc.c" +#include "battle/common/stage/area_kmr/kmr_06.inc.c" diff --git a/src/battle/area/kmr_part_2/actor/blue_goomba_1.c b/src/battle/area/kmr_part_2/actor/blue_goomba_1.c index 11028b3766..f91f5c225f 100644 --- a/src/battle/area/kmr_part_2/actor/blue_goomba_1.c +++ b/src/battle/area/kmr_part_2/actor/blue_goomba_1.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/GoombaBros.h" -#define NAMESPACE b_area_kmr_part_2_blue_goomba_1 +#define NAMESPACE A(blue_goomba_1) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -179,41 +177,41 @@ EvtScript N(handleEvent_80219D74) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Blue_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Blue_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_BurnStill) EVT_EXEC_WAIT(N(doDeath_8021B388)) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(N(doDeath_8021B388)) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -228,10 +226,10 @@ EvtScript N(handleEvent_80219D74) = { EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(N(doDeath_8021B388)) EVT_RETURN @@ -239,16 +237,16 @@ EvtScript N(handleEvent_80219D74) = { EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(N(doDeath_8021B388)) EVT_RETURN @@ -261,21 +259,21 @@ EvtScript N(handleEvent_80219D74) = { EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Run) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/area/kmr_part_2/actor/blue_goomba_2.c b/src/battle/area/kmr_part_2/actor/blue_goomba_2.c index 2b412b8f1e..e37e151907 100644 --- a/src/battle/area/kmr_part_2/actor/blue_goomba_2.c +++ b/src/battle/area/kmr_part_2/actor/blue_goomba_2.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/GoombaBros.h" -#define NAMESPACE b_area_kmr_part_2_blue_goomba_2 +#define NAMESPACE A(blue_goomba_2) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -175,41 +173,41 @@ EvtScript N(handleEvent_8021D8C4) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Blue_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Blue_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -224,10 +222,10 @@ EvtScript N(handleEvent_8021D8C4) = { EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -235,16 +233,16 @@ EvtScript N(handleEvent_8021D8C4) = { EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -257,21 +255,21 @@ EvtScript N(handleEvent_8021D8C4) = { EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Run) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Blue_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/area/kmr_part_2/actor/goomba_king.c b/src/battle/area/kmr_part_2/actor/goomba_king.c index 9658d0c47c..95e349a9c3 100644 --- a/src/battle/area/kmr_part_2/actor/goomba_king.c +++ b/src/battle/area/kmr_part_2/actor/goomba_king.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/GoombaKing.h" -#define NAMESPACE b_area_kmr_part_2_goomba_king +#define NAMESPACE A(goomba_king) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -246,78 +243,78 @@ EvtScript N(handleEvent_80220F34) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(9) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaKing_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(N(80220DB0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) EVT_KILL_THREAD(LVar0) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(N(doDeath_80222F50)) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) EVT_KILL_THREAD(LVar0) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(N(doDeath_80222F50)) EVT_RETURN EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaKing_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) EVT_KILL_THREAD(LVar0) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_BurnStill) EVT_EXEC_WAIT(N(doDeath_80222F50)) EVT_RETURN EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) EVT_KILL_THREAD(LVar0) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Dead) EVT_EXEC_WAIT(N(doDeath_80222F50)) EVT_RETURN @@ -330,12 +327,12 @@ EvtScript N(handleEvent_80220F34) = { EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GoombaKing_Idle) EVT_CASE_EQ(53) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Idle) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaKing_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/kmr_part_2/actor/goomnut_tree.c b/src/battle/area/kmr_part_2/actor/goomnut_tree.c index 6207a394c9..1697bf6920 100644 --- a/src/battle/area/kmr_part_2/actor/goomnut_tree.c +++ b/src/battle/area/kmr_part_2/actor/goomnut_tree.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/SpikyGoomnut.h" -#define NAMESPACE b_area_kmr_part_2_goomnut_tree +#define NAMESPACE A(goomnut_tree) enum N(ActorPartIDs) { PRT_MAIN = 1, diff --git a/src/battle/area/kmr_part_2/actor/red_goomba_1.c b/src/battle/area/kmr_part_2/actor/red_goomba_1.c index 6c2b220103..87f54e2fd0 100644 --- a/src/battle/area/kmr_part_2/actor/red_goomba_1.c +++ b/src/battle/area/kmr_part_2/actor/red_goomba_1.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/GoombaBros.h" -#define NAMESPACE b_area_kmr_part_2_red_goomba_1 +#define NAMESPACE A(red_goomba_1) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -179,41 +177,41 @@ EvtScript N(handleEvent_8021BB84) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Red_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Red_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_BurnStill) EVT_EXEC_WAIT(N(doDeath_8021D0C4)) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(N(doDeath_8021D0C4)) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -228,10 +226,10 @@ EvtScript N(handleEvent_8021BB84) = { EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(N(doDeath_8021D0C4)) EVT_RETURN @@ -239,16 +237,16 @@ EvtScript N(handleEvent_8021BB84) = { EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(N(doDeath_8021D0C4)) EVT_RETURN @@ -261,21 +259,21 @@ EvtScript N(handleEvent_8021BB84) = { EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Run) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/area/kmr_part_2/actor/red_goomba_2.c b/src/battle/area/kmr_part_2/actor/red_goomba_2.c index ac93ec8d07..3c283a2ee9 100644 --- a/src/battle/area/kmr_part_2/actor/red_goomba_2.c +++ b/src/battle/area/kmr_part_2/actor/red_goomba_2.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/GoombaBros.h" -#define NAMESPACE b_area_kmr_part_2_red_goomba_2 +#define NAMESPACE A(red_goomba_2) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -175,41 +173,41 @@ EvtScript N(handleEvent_8021F2C4) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Red_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_BurnHurt) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Red_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -224,10 +222,10 @@ EvtScript N(handleEvent_8021F2C4) = { EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -235,16 +233,16 @@ EvtScript N(handleEvent_8021F2C4) = { EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -257,21 +255,21 @@ EvtScript N(handleEvent_8021F2C4) = { EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Run) EVT_SET_CONST(LVar2, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GoombaBros_Red_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/area/kmr_part_2/area.c b/src/battle/area/kmr_part_2/area.c index a4396b008c..67cc9d80c6 100644 --- a/src/battle/area/kmr_part_2/area.c +++ b/src/battle/area/kmr_part_2/area.c @@ -1,53 +1,49 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "area.h" -#define NAMESPACE b_area_kmr_part_2 +extern ActorBlueprint A(red_goomba_1); +extern ActorBlueprint A(red_goomba_2); +extern ActorBlueprint A(blue_goomba_1); +extern ActorBlueprint A(blue_goomba_2); +extern ActorBlueprint A(goomba_king); +extern ActorBlueprint A(goomnut_tree); -extern ActorBlueprint N(red_goomba_1); -extern ActorBlueprint N(red_goomba_2); -extern ActorBlueprint N(blue_goomba_1); -extern ActorBlueprint N(blue_goomba_2); -extern ActorBlueprint N(goomba_king); -extern ActorBlueprint N(goomnut_tree); +extern Stage A(kmr_02); +extern Stage A(kmr_03); +extern Stage A(kmr_04); +extern Stage A(kmr_05); +extern Stage A(kmr_06); -extern Stage N(kmr_02); -extern Stage N(kmr_03); -extern Stage N(kmr_04); -extern Stage N(kmr_05); -extern Stage N(kmr_06); +Vec3i A(BlueMinibossPos) = { 14, 0, -10 }; +Vec3i A(RedMinibossPos) = { 54, 0, 32 }; -Vec3i N(BlueMinibossPos) = { 14, 0, -10 }; -Vec3i N(RedMinibossPos) = { 54, 0, 32 }; - -Formation N(Formation_00) = { - ACTOR_BY_POS(N(blue_goomba_1), N(BlueMinibossPos), 10), - ACTOR_BY_POS(N(red_goomba_1), N(RedMinibossPos), 10), +Formation A(Formation_00) = { + ACTOR_BY_POS(A(blue_goomba_1), A(BlueMinibossPos), 10), + ACTOR_BY_POS(A(red_goomba_1), A(RedMinibossPos), 10), }; -Vec3i N(KingBossPos) = { 10, 0, 10 }; -Vec3i N(RedBossPos) = { 70, 0, 30 }; -Vec3i N(BlueBossPos) = { 125, 0, 20 }; -Vec3i N(TreeBossPos) = { -40, 0, -45 }; +Vec3i A(KingBossPos) = { 10, 0, 10 }; +Vec3i A(RedBossPos) = { 70, 0, 30 }; +Vec3i A(BlueBossPos) = { 125, 0, 20 }; +Vec3i A(TreeBossPos) = { -40, 0, -45 }; -Formation N(Formation_01) = { - ACTOR_BY_POS(N(goomba_king), N(KingBossPos), 10), - ACTOR_BY_POS(N(red_goomba_2), N(RedBossPos), 10), - ACTOR_BY_POS(N(blue_goomba_2), N(BlueBossPos), 10), - ACTOR_BY_POS(N(goomnut_tree), N(TreeBossPos), 10), +Formation A(Formation_01) = { + ACTOR_BY_POS(A(goomba_king), A(KingBossPos), 10), + ACTOR_BY_POS(A(red_goomba_2), A(RedBossPos), 10), + ACTOR_BY_POS(A(blue_goomba_2), A(BlueBossPos), 10), + ACTOR_BY_POS(A(goomnut_tree), A(TreeBossPos), 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kmr_03), "クリレッド,クリブルー"), - BATTLE(N(Formation_01), N(kmr_06), "クリキング,クリレッド,クリブルー"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kmr_03), "クリレッド,クリブルー"), + BATTLE(A(Formation_01), A(kmr_06), "クリキング,クリレッド,クリブルー"), {}, }; -StageList N(Stages) = { - STAGE("kmr_02", N(kmr_02)), - STAGE("kmr_03", N(kmr_03)), - STAGE("kmr_04", N(kmr_04)), - STAGE("kmr_05", N(kmr_05)), - STAGE("kmr_06", N(kmr_06)), +StageList A(Stages) = { + STAGE("kmr_02", A(kmr_02)), + STAGE("kmr_03", A(kmr_03)), + STAGE("kmr_04", A(kmr_04)), + STAGE("kmr_05", A(kmr_05)), + STAGE("kmr_06", A(kmr_06)), {}, }; diff --git a/src/battle/area/kmr_part_2/area.h b/src/battle/area/kmr_part_2/area.h new file mode 100644 index 0000000000..1bb1246921 --- /dev/null +++ b/src/battle/area/kmr_part_2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kmr_part_2 diff --git a/src/battle/area/kmr_part_2/stage/kmr_02.c b/src/battle/area/kmr_part_2/stage/kmr_02.c index 91129eca2c..77d9023a8f 100644 --- a/src/battle/area/kmr_part_2/stage/kmr_02.c +++ b/src/battle/area/kmr_part_2/stage/kmr_02.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_2_kmr_02 - -#include "battle/common/stage/kmr_02.inc.c" +#include "battle/common/stage/area_kmr/kmr_02.inc.c" diff --git a/src/battle/area/kmr_part_2/stage/kmr_03.c b/src/battle/area/kmr_part_2/stage/kmr_03.c index dbd179fee8..db0b568e9b 100644 --- a/src/battle/area/kmr_part_2/stage/kmr_03.c +++ b/src/battle/area/kmr_part_2/stage/kmr_03.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_2_kmr_03 - -#include "battle/common/stage/kmr_03.inc.c" +#include "battle/common/stage/area_kmr/kmr_03.inc.c" diff --git a/src/battle/area/kmr_part_2/stage/kmr_04.c b/src/battle/area/kmr_part_2/stage/kmr_04.c index a11a9cde13..1d0ffbaa59 100644 --- a/src/battle/area/kmr_part_2/stage/kmr_04.c +++ b/src/battle/area/kmr_part_2/stage/kmr_04.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_2_kmr_04 - -#include "battle/common/stage/kmr_04.inc.c" +#include "battle/common/stage/area_kmr/kmr_04.inc.c" diff --git a/src/battle/area/kmr_part_2/stage/kmr_05.c b/src/battle/area/kmr_part_2/stage/kmr_05.c index e611768d44..04314f7f60 100644 --- a/src/battle/area/kmr_part_2/stage/kmr_05.c +++ b/src/battle/area/kmr_part_2/stage/kmr_05.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_2_kmr_05 - -#include "battle/common/stage/kmr_05.inc.c" +#include "battle/common/stage/area_kmr/kmr_05.inc.c" diff --git a/src/battle/area/kmr_part_2/stage/kmr_06.c b/src/battle/area/kmr_part_2/stage/kmr_06.c index 0929b16145..91f587accc 100644 --- a/src/battle/area/kmr_part_2/stage/kmr_06.c +++ b/src/battle/area/kmr_part_2/stage/kmr_06.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_2_kmr_06 - -#include "battle/common/stage/kmr_06.inc.c" +#include "battle/common/stage/area_kmr/kmr_06.inc.c" diff --git a/src/battle/area/kmr_part_3/actor/egg_jr_troopa.c b/src/battle/area/kmr_part_3/actor/egg_jr_troopa.c index a0ac4960ea..58d25d3fdb 100644 --- a/src/battle/area/kmr_part_3/actor/egg_jr_troopa.c +++ b/src/battle/area/kmr_part_3/actor/egg_jr_troopa.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/JrTroopa.h" -#define NAMESPACE b_area_kmr_part_3_egg_jr_troopa +#define NAMESPACE A(egg_jr_troopa) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -242,21 +240,21 @@ EvtScript N(handleEvent_80224B58) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(9) EVT_EXEC_WAIT(N(802250E4)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(10) EVT_EXEC_WAIT(N(802250E4)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(802251CC)) EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Panic) EVT_EXEC_WAIT(N(80224658)) EVT_RETURN @@ -271,63 +269,63 @@ EvtScript N(handleEvent_80224B58) = { EVT_SET(LVar2, ANIM_JrTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_BurnStill) EVT_EXEC_WAIT(N(80224658)) EVT_RETURN EVT_CASE_EQ(11) EVT_EXEC_WAIT(N(802250E4)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(802251CC)) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Panic) EVT_EXEC_WAIT(N(80224658)) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_EXEC_WAIT(N(80224964)) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Panic) EVT_EXEC_WAIT(N(80224658)) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_EggIdle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(53) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/kmr_part_3/actor/final_jr_troopa.c b/src/battle/area/kmr_part_3/actor/final_jr_troopa.c index 32237c1e04..d77c748de1 100644 --- a/src/battle/area/kmr_part_3/actor/final_jr_troopa.c +++ b/src/battle/area/kmr_part_3/actor/final_jr_troopa.c @@ -1,11 +1,9 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/JrTroopa.h" #include "sprite/npc/SpikedParaJrTroopa.h" #include "sprite/npc/MageJrTroopa.h" -#define NAMESPACE b_area_kmr_part_3_final_jr_troopa +#define NAMESPACE A(final_jr_troopa) #include "common/battle/SetAbsoluteStatusOffsets.inc.c" @@ -368,7 +366,7 @@ EvtScript N(idle_8022D058) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(2) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x41000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_DIZZY | STATUS_FLAG_SLEEP) EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_2, -15, 28) EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_2, 4, -6) EVT_CALL(N(SetAbsoluteStatusOffsets), -25, 27, -1, 27) @@ -512,7 +510,7 @@ EvtScript N(handleEvent_8022D1C4) = { EVT_EXEC_WAIT(N(80232040)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/kmr_part_3/actor/jr_troopa.c b/src/battle/area/kmr_part_3/actor/jr_troopa.c index f04e36f585..07d189934f 100644 --- a/src/battle/area/kmr_part_3/actor/jr_troopa.c +++ b/src/battle/area/kmr_part_3/actor/jr_troopa.c @@ -1,10 +1,9 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/JrTroopa.h" #include "sprite/npc/ParaJrTroopa.h" +#include "sprite/npc/Goompa.h" -#define NAMESPACE b_area_kmr_part_3_jr_troopa +#define NAMESPACE A(jr_troopa) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -189,7 +188,7 @@ EvtScript N(80222C78) = { EVT_WAIT(1) EVT_CALL(SetActorYaw, ACTOR_PLAYER, 180) EVT_WAIT(5) - EVT_CALL(ActorSpeak, MSG_CH0_00B4, ACTOR_PARTNER, 0, 0x009D0008, 0x009D0001) + EVT_CALL(ActorSpeak, MSG_CH0_00B4, ACTOR_PARTNER, 0, ANIM_Goompa_Talk, ANIM_Goompa_Idle) EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150) EVT_WAIT(1) EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120) @@ -247,22 +246,22 @@ EvtScript N(handleEvent_80223290) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Panic) EVT_EXEC_WAIT(N(80222C78)) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_JrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP @@ -408,7 +407,7 @@ EvtScript N(nextTurn_80223D2C) = { EVT_END_LOOP EVT_END_THREAD EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_JrTroopa_Punch) - EVT_CALL(ActorSpeak, MSG_CH0_00AF, ACTOR_PARTNER, 0, 0x009D0008, 0x009D0001) + EVT_CALL(ActorSpeak, MSG_CH0_00AF, ACTOR_PARTNER, 0, ANIM_Goompa_Talk, ANIM_Goompa_Idle) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_JrTroopa_Idle) EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_NodYes) EVT_WAIT(10) @@ -443,7 +442,7 @@ EvtScript N(nextTurn_80223D2C) = { EVT_END_LOOP EVT_END_THREAD EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_CH0_00B0, ACTOR_PARTNER, 0, 0x009D0008, 0x009D0001) + EVT_CALL(ActorSpeak, MSG_CH0_00B0, ACTOR_PARTNER, 0, ANIM_Goompa_Talk, ANIM_Goompa_Idle) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_ThumbsUp) EVT_WAIT(20) @@ -457,7 +456,7 @@ EvtScript N(nextTurn_80223D2C) = { EVT_IF_LE(LVar0, 1) EVT_CALL(SetActorVar, ACTOR_SELF, 3, 1) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_CH0_00B2, ACTOR_PARTNER, 0, 0x009D0008, 0x009D0001) + EVT_CALL(ActorSpeak, MSG_CH0_00B2, ACTOR_PARTNER, 0, ANIM_Goompa_Talk, ANIM_Goompa_Idle) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_EXEC_WAIT(N(80222B30)) EVT_CALL(ActorSpeak, MSG_CH0_00B3, ACTOR_SELF, PRT_MAIN, 0x00210016, 0x00210003) diff --git a/src/battle/area/kmr_part_3/actor/mage_jr_troopa.c b/src/battle/area/kmr_part_3/actor/mage_jr_troopa.c index b5bf907b02..18d4a2f8d5 100644 --- a/src/battle/area/kmr_part_3/actor/mage_jr_troopa.c +++ b/src/battle/area/kmr_part_3/actor/mage_jr_troopa.c @@ -1,11 +1,8 @@ -#include "common.h" -#include "hud_element.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/JrTroopa.h" #include "sprite/npc/MageJrTroopa.h" -#define NAMESPACE b_area_kmr_part_3_mage_jr_troopa +#define NAMESPACE A(mage_jr_troopa) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -253,21 +250,21 @@ EvtScript N(handleEvent_8022ADD8) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(9) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8022A750)) EVT_EXEC_WAIT(N(8022C2A4)) EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Still) EVT_EXEC_WAIT(N(8022BF1C)) EVT_RETURN @@ -282,50 +279,50 @@ EvtScript N(handleEvent_8022ADD8) = { EVT_SET(LVar2, 2359307) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_BurnStill) EVT_EXEC_WAIT(N(8022BF1C)) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(N(8022BF1C)) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Still) EVT_EXEC_WAIT(N(8022BF1C)) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_EXEC_WAIT(N(8022A750)) @@ -356,12 +353,12 @@ EvtScript N(handleEvent_8022ADD8) = { EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MageJrTroopa_Idle) EVT_CASE_EQ(53) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MageJrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/kmr_part_3/actor/para_jr_troopa.c b/src/battle/area/kmr_part_3/actor/para_jr_troopa.c index 34d1a0d114..bbe7d766be 100644 --- a/src/battle/area/kmr_part_3/actor/para_jr_troopa.c +++ b/src/battle/area/kmr_part_3/actor/para_jr_troopa.c @@ -1,10 +1,8 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/JrTroopa.h" #include "sprite/npc/ParaJrTroopa.h" -#define NAMESPACE b_area_kmr_part_3_para_jr_troopa +#define NAMESPACE A(para_jr_troopa) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -226,7 +224,7 @@ EvtScript N(init_80226510) = { EvtScript N(idle_802265A0) = { EVT_LABEL(0) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x41000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_DIZZY | STATUS_FLAG_SLEEP) EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -12, 28) EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 4, -6) EVT_CALL(N(SetAbsoluteStatusOffsets), -25, 27, -1, 27) @@ -252,18 +250,18 @@ EvtScript N(handleEvent_802266B0) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(80225F7C)) EVT_EXEC_WAIT(N(80227E1C)) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(N(802279B0)) EVT_RETURN @@ -278,48 +276,48 @@ EvtScript N(handleEvent_802266B0) = { EVT_SET(LVar2, 2424841) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_BurnStill) EVT_EXEC_WAIT(N(802279B0)) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(N(802279B0)) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(80227D38)) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ParaJrTroopa_Idle) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Idle) EVT_EXEC_WAIT(N(802279B0)) EVT_RETURN EVT_CASE_EQ(23) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(25) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_EXEC_WAIT(N(80225F7C)) @@ -341,7 +339,7 @@ EvtScript N(handleEvent_802266B0) = { EVT_CASE_EQ(31) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Flail) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_EXEC_WAIT(N(802263D4)) @@ -349,12 +347,12 @@ EvtScript N(handleEvent_802266B0) = { EVT_EXEC_WAIT(N(8022646C)) EVT_END_IF EVT_CASE_EQ(53) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ParaJrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/kmr_part_3/actor/paragoomba.c b/src/battle/area/kmr_part_3/actor/paragoomba.c index 80e7364733..2d2fefd360 100644 --- a/src/battle/area/kmr_part_3/actor/paragoomba.c +++ b/src/battle/area/kmr_part_3/actor/paragoomba.c @@ -1,995 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Paragoomba.h" -#include "sprite/npc/Goomba.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_3_paragoomba1 - -extern s32 N(IdleAnimations_8021DB9C)[]; -extern s32 N(IdleAnimations_8021C3D8)[]; -extern s32 N(IdleAnimations_8021C470)[]; -extern s32 N(IdleAnimations_8021C47C)[]; -extern EvtScript N(init_8021F450); -extern EvtScript N(takeTurn_8021CDFC); -extern EvtScript N(idle_8021C4D4); -extern EvtScript N(handleEvent_8021C808); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, -}; - -s32 N(DefenseTable_8021C1B0)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(DefenseTable_8021C1BC)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8021C1C8)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 100, - STATUS_KEY_POISON, 100, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 100, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 100, - STATUS_KEY_PARALYZE, 100, - STATUS_KEY_SHRINK, 100, - STATUS_KEY_STOP, 100, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -s32 N(StatusTable_8021C274)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 100, - STATUS_KEY_POISON, 80, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 100, - STATUS_KEY_FEAR, 80, - STATUS_KEY_STATIC, 80, - STATUS_KEY_PARALYZE, 100, - STATUS_KEY_SHRINK, 100, - STATUS_KEY_STOP, 100, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 20 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021DB9C), - .defenseTable = N(DefenseTable_8021C1B0), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021C3D8), - .defenseTable = N(DefenseTable_8021C1BC), - .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -16, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021C470), - .defenseTable = N(DefenseTable_8021C1B0), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_4, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -16, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021C47C), - .defenseTable = N(DefenseTable_8021C1B0), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_FLYING, - .type = ACTOR_TYPE_PARAGOOMBA, - .level = 6, - .maxHP = 2, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021F450), - .statusTable = N(StatusTable_8021C274), - .escapeChance = 90, - .airLiftChance = 100, - .hurricaneChance = 100, - .spookChance = 100, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 36, 26 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_8021C3D8)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Idle, - STATUS_KEY_STONE, ANIM_Paragoomba_Still, - STATUS_KEY_SLEEP, ANIM_Paragoomba_Sleep, - STATUS_KEY_POISON, ANIM_Paragoomba_Idle, - STATUS_KEY_STOP, ANIM_Paragoomba_Still, - STATUS_KEY_STATIC, ANIM_Paragoomba_Idle, - STATUS_KEY_PARALYZE, ANIM_Paragoomba_Still, - STATUS_KEY_DIZZY, ANIM_Paragoomba_Dizzy, - STATUS_KEY_FEAR, ANIM_Paragoomba_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_8021C424)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Run, - STATUS_KEY_STONE, ANIM_Paragoomba_Still, - STATUS_KEY_SLEEP, ANIM_Paragoomba_Sleep, - STATUS_KEY_POISON, ANIM_Paragoomba_Idle, - STATUS_KEY_STOP, ANIM_Paragoomba_Still, - STATUS_KEY_STATIC, ANIM_Paragoomba_Run, - STATUS_KEY_PARALYZE, ANIM_Paragoomba_Still, - STATUS_KEY_DIZZY, ANIM_Paragoomba_Dizzy, - STATUS_KEY_FEAR, ANIM_Paragoomba_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_8021C470)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_LWingStill, - STATUS_END, -}; - -s32 N(IdleAnimations_8021C47C)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_RWingStill, - STATUS_END, -}; - -EvtScript N(8021C488) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021CDFC))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C4D4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C808))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_8021C4D4) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C424))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C3D8))) - EVT_LOOP(40) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021C790) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Idle) - EVT_RETURN - EVT_END -}; - -extern EvtScript N(8021D614); - -EvtScript N(handleEvent_8021C808) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(9) - EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(GetEncounterState, LVar0) - EVT_IF_EQ(LVar0, 4) - EVT_EXEC_WAIT(N(8021D614)) - EVT_END_IF - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(12) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_EXEC_WAIT(N(8021D614)) - EVT_CASE_EQ(15) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(8021D614)) - EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dizzy) - EVT_EXEC_WAIT(N(8021C790)) - EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(19) - EVT_CASE_OR_EQ(23) - EVT_CASE_OR_EQ(25) - EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(56) - EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) - EVT_CALL(HPBarToCurrent, ACTOR_SELF) - EVT_CASE_EQ(53) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) - EVT_EXEC_WAIT(N(8021C790)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(57) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, 512, FALSE) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Run) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000002) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021CDFC) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_LINEAR) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, ((0)), 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(6) - EVT_CASE_OR_EQ(5) - EVT_SET(LVarA, LVar0) - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) - EVT_CALL(SetBattleCamZoom, 300) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_SUB(LVar0, 80) - EVT_SET(LVar1, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) - EVT_THREAD - EVT_LOOP(4) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DF) - EVT_WAIT(4) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Miss) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(3.0)) - EVT_WAIT(10) - EVT_IF_EQ(LVarA, 5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0x80000000, 0, 0, 0) - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(8021C790)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) - EVT_CALL(SetBattleCamZoom, 300) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) - EVT_END_SWITCH - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, ((0)), 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(2) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) - EVT_EXEC_WAIT(N(8021C790)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/StartRumbleWithParams.inc.c" - -extern EvtScript N(8021DC34); - -EvtScript N(8021D614) = { - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, 0x00020005) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, 0x00120004) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_4, 0x00120004) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, 0x00800004) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_3, -9, 7, -2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_4, 11, 7, -2) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar0, 15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_BurnStill) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hurt) - EVT_END_IF - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 100, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) - EVT_END_THREAD - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar3) - EVT_IF_EQ(LVar3, 15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hurt) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_ADD(LVar4, 10) - EVT_ADD(LVar5, 5) - EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar3, LVar4, LVar5, EVT_FLOAT(1.0), 10, 0) - EVT_END_IF - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_LOOP(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, 1, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, 1, TRUE) - EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, 1, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, 1, FALSE) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, 1, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, 1, TRUE) - EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) - EVT_MOD(LVar0, 4) - EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, 512, FALSE) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_8021C1C8))) - EVT_CALL(SetActorType, ACTOR_SELF, 7) - EVT_EXEC_WAIT(N(8021DC34)) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, 0x00001000, TRUE) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_RETURN - EVT_END -}; - -s32 N(IdleAnimations_8021DB9C)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Idle, - STATUS_KEY_STONE, ANIM_Goomba_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Idle, - STATUS_KEY_PARALYZE, ANIM_Goomba_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_8021DBE8)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Run, - STATUS_KEY_STONE, ANIM_Goomba_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Run, - STATUS_KEY_PARALYZE, ANIM_Goomba_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Dizzy, - STATUS_END, -}; - -extern EvtScript N(takeTurn_8021E788); -extern EvtScript N(idle); -extern EvtScript N(handleEvent_8021DF5C); - -EvtScript N(8021DC34) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021E788))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021DF5C))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DBE8))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DB9C))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DBE8))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DB9C))) - EVT_LOOP(80) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021DF5C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(9) - EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dizzy) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(19) - EVT_CASE_OR_EQ(23) - EVT_CASE_OR_EQ(25) - EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(53) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Run) - EVT_SET_CONST(LVar2, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/CalculateArcsinDeg.inc.c" - -EvtScript N(takeTurn_8021E788) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, ((0)), 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(6) - EVT_CASE_OR_EQ(5) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 10) - EVT_ADD(LVar2, 3) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Sleep) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hurt) - EVT_WAIT(5) - EVT_IF_EQ(LVarA, 5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0x80000000, 0, 0, 0) - EVT_END_IF - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_THREAD - EVT_WAIT(4) - EVT_SET(LVar0, 180) - EVT_LOOP(4) - EVT_SUB(LVar0, 45) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dizzy) - EVT_WAIT(5) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Tense) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_END_SWITCH - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, ((0)), 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(2) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_WAIT(3) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -extern EvtScript N(nextTurn_8021F690); - -EvtScript N(init_8021F450) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021CDFC))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C4D4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C808))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_8021F690))) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021F4B0) = { - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 180) - EVT_WAIT(5) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 10) - EVT_CALL(ActorSpeak, MSG_CH0_00B8, ACTOR_PARTNER, 0, 0x009D0008, 0x009D0001) - EVT_SET(GF_Tutorial_FlyingEnemy, 1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30) - EVT_WAIT(1) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 0) - EVT_WAIT(5) - EVT_RETURN - EVT_END -}; - -EvtScript N(nextTurn_8021F690) = { - EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_PARTNER, 0) - EVT_CALL(GetBattlePhase, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(10) - EVT_IF_EQ(GF_Tutorial_FlyingEnemy, 0) - EVT_EXEC_WAIT(N(8021F4B0)) - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_PARTNER, 1) - EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/paragoomba.inc.c" diff --git a/src/battle/area/kmr_part_3/actor/paragoomba2.c b/src/battle/area/kmr_part_3/actor/paragoomba2.c deleted file mode 100644 index ef021912ac..0000000000 --- a/src/battle/area/kmr_part_3/actor/paragoomba2.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "common.h" - -#define NAMESPACE b_area_kmr_part_3_paragoomba2 - -#include "battle/common/actor/paragoomba.inc.c" diff --git a/src/battle/area/kmr_part_3/actor/spiked_para_jr_troopa.c b/src/battle/area/kmr_part_3/actor/spiked_para_jr_troopa.c index 0deeb2a4ae..db4c52a687 100644 --- a/src/battle/area/kmr_part_3/actor/spiked_para_jr_troopa.c +++ b/src/battle/area/kmr_part_3/actor/spiked_para_jr_troopa.c @@ -1,11 +1,8 @@ -#include "common.h" -#include "hud_element.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/JrTroopa.h" #include "sprite/npc/SpikedParaJrTroopa.h" -#define NAMESPACE b_area_kmr_part_3_spiked_para_jr_troopa +#define NAMESPACE A(spiked_para_jr_troopa) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -221,7 +218,7 @@ EvtScript N(init_80228618) = { EvtScript N(idle_802286C0) = { EVT_LABEL(0) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x41000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_DIZZY | STATUS_FLAG_SLEEP) EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -15, 28) EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 4, -6) EVT_CALL(N(SetAbsoluteStatusOffsets), -25, 27, -1, 27) @@ -249,23 +246,23 @@ EvtScript N(handleEvent_802287D0) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(9) EVT_EXEC_WAIT(N(80228FE8)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(10) EVT_EXEC_WAIT(N(80228FE8)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8022906C)) EVT_EXEC_WAIT(N(80228084)) EVT_EXEC_WAIT(N(8022A480)) EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(N(8022A018)) EVT_RETURN @@ -283,47 +280,47 @@ EvtScript N(handleEvent_802287D0) = { EVT_SET(LVar2, 2293771) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_BurnStill) EVT_EXEC_WAIT(N(8022A018)) EVT_RETURN EVT_CASE_EQ(11) EVT_EXEC_WAIT(N(80228FE8)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(8022906C)) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(N(8022A018)) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(8022A39C)) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedParaJrTroopa_Idle) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Still) EVT_EXEC_WAIT(N(8022A018)) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_EXEC_WAIT(N(80228084)) @@ -374,7 +371,7 @@ EvtScript N(handleEvent_802287D0) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedParaJrTroopa_Idle) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedParaJrTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT diff --git a/src/battle/area/kmr_part_3/actor/tutorial_paragoomba.c b/src/battle/area/kmr_part_3/actor/tutorial_paragoomba.c new file mode 100644 index 0000000000..10043e4a62 --- /dev/null +++ b/src/battle/area/kmr_part_3/actor/tutorial_paragoomba.c @@ -0,0 +1,994 @@ +#include "../area.h" +#include "sprite/npc/Paragoomba.h" +#include "sprite/npc/Goomba.h" +#include "sprite/npc/Goompa.h" + +#define NAMESPACE A(tutorial_paragoomba) + +extern s32 N(IdleAnimations_8021DB9C)[]; +extern s32 N(IdleAnimations_8021C3D8)[]; +extern s32 N(IdleAnimations_8021C470)[]; +extern s32 N(IdleAnimations_8021C47C)[]; +extern EvtScript N(init_8021F450); +extern EvtScript N(takeTurn_8021CDFC); +extern EvtScript N(idle_8021C4D4); +extern EvtScript N(handleEvent_8021C808); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, + PRT_4 = 4, +}; + +s32 N(DefenseTable_8021C1B0)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(DefenseTable_8021C1BC)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8021C1C8)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 100, + STATUS_KEY_POISON, 100, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 100, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 100, + STATUS_KEY_PARALYZE, 100, + STATUS_KEY_SHRINK, 100, + STATUS_KEY_STOP, 100, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +s32 N(StatusTable_8021C274)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 100, + STATUS_KEY_POISON, 80, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 100, + STATUS_KEY_FEAR, 80, + STATUS_KEY_STATIC, 80, + STATUS_KEY_PARALYZE, 100, + STATUS_KEY_SHRINK, 100, + STATUS_KEY_STOP, 100, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 20 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021DB9C), + .defenseTable = N(DefenseTable_8021C1B0), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021C3D8), + .defenseTable = N(DefenseTable_8021C1BC), + .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -16, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021C470), + .defenseTable = N(DefenseTable_8021C1B0), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_4, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -16, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021C47C), + .defenseTable = N(DefenseTable_8021C1B0), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_PARAGOOMBA, + .level = 6, + .maxHP = 2, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021F450), + .statusTable = N(StatusTable_8021C274), + .escapeChance = 90, + .airLiftChance = 100, + .hurricaneChance = 100, + .spookChance = 100, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 36, 26 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_8021C3D8)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Idle, + STATUS_KEY_STONE, ANIM_Paragoomba_Still, + STATUS_KEY_SLEEP, ANIM_Paragoomba_Sleep, + STATUS_KEY_POISON, ANIM_Paragoomba_Idle, + STATUS_KEY_STOP, ANIM_Paragoomba_Still, + STATUS_KEY_STATIC, ANIM_Paragoomba_Idle, + STATUS_KEY_PARALYZE, ANIM_Paragoomba_Still, + STATUS_KEY_DIZZY, ANIM_Paragoomba_Dizzy, + STATUS_KEY_FEAR, ANIM_Paragoomba_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_8021C424)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Run, + STATUS_KEY_STONE, ANIM_Paragoomba_Still, + STATUS_KEY_SLEEP, ANIM_Paragoomba_Sleep, + STATUS_KEY_POISON, ANIM_Paragoomba_Idle, + STATUS_KEY_STOP, ANIM_Paragoomba_Still, + STATUS_KEY_STATIC, ANIM_Paragoomba_Run, + STATUS_KEY_PARALYZE, ANIM_Paragoomba_Still, + STATUS_KEY_DIZZY, ANIM_Paragoomba_Dizzy, + STATUS_KEY_FEAR, ANIM_Paragoomba_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_8021C470)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_LWingStill, + STATUS_END, +}; + +s32 N(IdleAnimations_8021C47C)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_RWingStill, + STATUS_END, +}; + +EvtScript N(8021C488) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021CDFC))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C4D4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C808))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_8021C4D4) = { + EVT_LABEL(10) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C424))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C3D8))) + EVT_LOOP(40) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_GOTO(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021C790) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Idle) + EVT_RETURN + EVT_END +}; + +extern EvtScript N(8021D614); + +EvtScript N(handleEvent_8021C808) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(9) + EVT_CASE_OR_EQ(10) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(GetEncounterTrigger, LVar0) + EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) + EVT_EXEC_WAIT(N(8021D614)) + EVT_END_IF + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(14) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(36) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(12) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_EXEC_WAIT(N(8021D614)) + EVT_CASE_EQ(15) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_EXEC_WAIT(N(8021D614)) + EVT_CASE_EQ(47) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dizzy) + EVT_EXEC_WAIT(N(8021C790)) + EVT_CASE_EQ(38) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(19) + EVT_CASE_OR_EQ(23) + EVT_CASE_OR_EQ(25) + EVT_CASE_OR_EQ(31) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(32) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(56) + EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) + EVT_CALL(HPBarToCurrent, ACTOR_SELF) + EVT_CASE_EQ(53) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) + EVT_EXEC_WAIT(N(8021C790)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(49) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(57) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, 512, FALSE) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Run) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(58) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(22) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021CDFC) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_LINEAR) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, ((0)), 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(6) + EVT_CASE_OR_EQ(5) + EVT_SET(LVarA, LVar0) + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) + EVT_CALL(SetBattleCamZoom, 300) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_SUB(LVar0, 80) + EVT_SET(LVar1, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) + EVT_THREAD + EVT_LOOP(4) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DF) + EVT_WAIT(4) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Miss) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(3.0)) + EVT_WAIT(10) + EVT_IF_EQ(LVarA, 5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0x80000000, 0, 0, 0) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_EXEC_WAIT(N(8021C790)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) + EVT_CALL(SetBattleCamZoom, 300) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) + EVT_END_SWITCH + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, ((0)), 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(2) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) + EVT_EXEC_WAIT(N(8021C790)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/StartRumbleWithParams.inc.c" + +extern EvtScript N(8021DC34); + +EvtScript N(8021D614) = { + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, 0x00020005) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, 0x00120004) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_4, 0x00120004) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, 0x00800004) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_3, -9, 7, -2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_4, 11, 7, -2) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar0, 15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_BurnStill) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hurt) + EVT_END_IF + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 100, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) + EVT_END_THREAD + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar3) + EVT_IF_EQ(LVar3, 15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hurt) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_ADD(LVar4, 10) + EVT_ADD(LVar5, 5) + EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar3, LVar4, LVar5, EVT_FLOAT(1.0), 10, 0) + EVT_END_IF + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_LOOP(10) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, 1, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, 1, TRUE) + EVT_WAIT(1) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, 1, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, 1, FALSE) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, 1, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, 1, TRUE) + EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) + EVT_MOD(LVar0, 4) + EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, 512, FALSE) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_8021C1C8))) + EVT_CALL(SetActorType, ACTOR_SELF, 7) + EVT_EXEC_WAIT(N(8021DC34)) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, 0x00001000, TRUE) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_RETURN + EVT_END +}; + +s32 N(IdleAnimations_8021DB9C)[] = { + STATUS_KEY_NORMAL, ANIM_Goomba_Idle, + STATUS_KEY_STONE, ANIM_Goomba_Still, + STATUS_KEY_SLEEP, ANIM_Goomba_Sleep, + STATUS_KEY_POISON, ANIM_Goomba_Idle, + STATUS_KEY_STOP, ANIM_Goomba_Still, + STATUS_KEY_STATIC, ANIM_Goomba_Idle, + STATUS_KEY_PARALYZE, ANIM_Goomba_Still, + STATUS_KEY_DIZZY, ANIM_Goomba_Dizzy, + STATUS_KEY_FEAR, ANIM_Goomba_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_8021DBE8)[] = { + STATUS_KEY_NORMAL, ANIM_Goomba_Run, + STATUS_KEY_STONE, ANIM_Goomba_Still, + STATUS_KEY_SLEEP, ANIM_Goomba_Sleep, + STATUS_KEY_POISON, ANIM_Goomba_Idle, + STATUS_KEY_STOP, ANIM_Goomba_Still, + STATUS_KEY_STATIC, ANIM_Goomba_Run, + STATUS_KEY_PARALYZE, ANIM_Goomba_Still, + STATUS_KEY_DIZZY, ANIM_Goomba_Dizzy, + STATUS_KEY_FEAR, ANIM_Goomba_Dizzy, + STATUS_END, +}; + +extern EvtScript N(takeTurn_8021E788); +extern EvtScript N(idle); +extern EvtScript N(handleEvent_8021DF5C); + +EvtScript N(8021DC34) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021E788))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021DF5C))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_LABEL(10) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DBE8))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DB9C))) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DBE8))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DB9C))) + EVT_LOOP(80) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_GOTO(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021DF5C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(9) + EVT_CASE_OR_EQ(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(14) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Goomba_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(36) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Goomba_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(11) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(33) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(47) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dizzy) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(38) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(19) + EVT_CASE_OR_EQ(23) + EVT_CASE_OR_EQ(25) + EVT_CASE_OR_EQ(31) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(32) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(53) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(49) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(57) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Run) + EVT_SET_CONST(LVar2, ANIM_Goomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(58) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(22) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/CalculateArcsinDeg.inc.c" + +EvtScript N(takeTurn_8021E788) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, ((0)), 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(6) + EVT_CASE_OR_EQ(5) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 10) + EVT_ADD(LVar2, 3) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Sleep) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hurt) + EVT_WAIT(5) + EVT_IF_EQ(LVarA, 5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0x80000000, 0, 0, 0) + EVT_END_IF + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_THREAD + EVT_WAIT(4) + EVT_SET(LVar0, 180) + EVT_LOOP(4) + EVT_SUB(LVar0, 45) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dizzy) + EVT_WAIT(5) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Tense) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_END_SWITCH + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, ((0)), 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(2) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) + EVT_WAIT(3) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +extern EvtScript N(nextTurn_8021F690); + +EvtScript N(init_8021F450) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021CDFC))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C4D4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C808))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_8021F690))) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021F4B0) = { + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 180) + EVT_WAIT(5) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 10) + EVT_CALL(ActorSpeak, MSG_CH0_00B8, ACTOR_PARTNER, 0, ANIM_Goompa_Talk, ANIM_Goompa_Idle) + EVT_SET(GF_Tutorial_FlyingEnemy, 1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30) + EVT_WAIT(1) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 0) + EVT_WAIT(5) + EVT_RETURN + EVT_END +}; + +EvtScript N(nextTurn_8021F690) = { + EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_PARTNER, 0) + EVT_CALL(GetBattlePhase, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(10) + EVT_IF_EQ(GF_Tutorial_FlyingEnemy, 0) + EVT_EXEC_WAIT(N(8021F4B0)) + EVT_END_IF + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_PARTNER, 1) + EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/area/kmr_part_3/actor/spiked_goomba.c b/src/battle/area/kmr_part_3/actor/tutorial_spiked_goomba.c similarity index 95% rename from src/battle/area/kmr_part_3/actor/spiked_goomba.c rename to src/battle/area/kmr_part_3/actor/tutorial_spiked_goomba.c index 8190cd2392..5791476b22 100644 --- a/src/battle/area/kmr_part_3/actor/spiked_goomba.c +++ b/src/battle/area/kmr_part_3/actor/tutorial_spiked_goomba.c @@ -1,9 +1,8 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/SpikedGoomba.h" +#include "sprite/npc/Goompa.h" -#define NAMESPACE b_area_kmr_part_3_spiked_goomba +#define NAMESPACE A(tutorial_spiked_goomba) extern s32 N(IdleAnimations_8021A494)[]; extern EvtScript N(init_8021BEBC); @@ -175,41 +174,41 @@ EvtScript N(handleEvent_8021A854) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_BurnEyesClosed) EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_BurnEyesOpen) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_BurnEyesClosed) EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_BurnEyesOpen) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_BurnEyesOpen) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -224,10 +223,10 @@ EvtScript N(handleEvent_8021A854) = { EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -235,16 +234,16 @@ EvtScript N(handleEvent_8021A854) = { EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -257,21 +256,21 @@ EvtScript N(handleEvent_8021A854) = { EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Run) EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -283,7 +282,7 @@ EvtScript N(handleEvent_8021A854) = { EVT_WAIT(10) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, 0x80000) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_ADD(LVar1, 10) EVT_ELSE EVT_ADD(LVar1, 26) @@ -505,7 +504,7 @@ EvtScript N(8021BF1C) = { EVT_WAIT(5) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(MoveBattleCamOver, 10) - EVT_CALL(ActorSpeak, MSG_CH0_00B9, ACTOR_PARTNER, 0, 0x009D0008, 0x009D0001) + EVT_CALL(ActorSpeak, MSG_CH0_00B9, ACTOR_PARTNER, 0, ANIM_Goompa_Talk, ANIM_Goompa_Idle) EVT_SET(GF_Tutorial_SpikyEnemy, 1) EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150) EVT_WAIT(1) diff --git a/src/battle/area/kmr_part_3/area.c b/src/battle/area/kmr_part_3/area.c index c830e5a522..179364e85c 100644 --- a/src/battle/area/kmr_part_3/area.c +++ b/src/battle/area/kmr_part_3/area.c @@ -1,79 +1,76 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_kmr_part_3 +extern ActorBlueprint A(jr_troopa); +extern ActorBlueprint A(egg_jr_troopa); +extern ActorBlueprint A(para_jr_troopa); +extern ActorBlueprint A(spiked_para_jr_troopa); +extern ActorBlueprint A(mage_jr_troopa); +extern ActorBlueprint A(final_jr_troopa); +extern ActorBlueprint A(paragoomba); +extern ActorBlueprint A(tutorial_paragoomba); +extern ActorBlueprint A(tutorial_spiked_goomba); -extern ActorBlueprint N(jr_troopa); -extern ActorBlueprint N(egg_jr_troopa); -extern ActorBlueprint N(para_jr_troopa); -extern ActorBlueprint N(spiked_para_jr_troopa); -extern ActorBlueprint N(mage_jr_troopa); -extern ActorBlueprint N(final_jr_troopa); -extern ActorBlueprint N(paragoomba1); -extern ActorBlueprint N(paragoomba2); -extern ActorBlueprint N(spiked_goomba); +extern Stage A(kmr_02); +extern Stage A(kmr_03); +extern Stage A(kmr_04); +extern Stage A(kmr_05b); +extern Stage A(kmr_06); +extern Stage A(nok_01); +extern Stage A(mim_01); +extern Stage A(sam_01); +extern Stage A(mac_01); +extern Stage A(kpa_13); -extern Stage N(kmr_02); -extern Stage N(kmr_03); -extern Stage N(kmr_04); -extern Stage N(kmr_05); -extern Stage N(kmr_06); -extern Stage N(nok_01); -extern Stage N(mim_01); -extern Stage N(sam_01); -extern Stage N(mac_01); -extern Stage N(kpa_01); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 0), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(tutorial_spiked_goomba), BTL_POS_GROUND_C, 0), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(paragoomba2), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(paragoomba1), BTL_POS_AIR_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(paragoomba), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(tutorial_paragoomba), BTL_POS_AIR_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(jr_troopa), BTL_POS_GROUND_C, 0), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(jr_troopa), BTL_POS_GROUND_C, 0), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(egg_jr_troopa), BTL_POS_GROUND_C, 0), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(egg_jr_troopa), BTL_POS_GROUND_C, 0), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(para_jr_troopa), BTL_POS_GROUND_C, 0), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(para_jr_troopa), BTL_POS_GROUND_C, 0), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(spiked_para_jr_troopa), BTL_POS_GROUND_B, 0), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(spiked_para_jr_troopa), BTL_POS_GROUND_B, 0), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(mage_jr_troopa), BTL_POS_GROUND_C, 0), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(mage_jr_troopa), BTL_POS_GROUND_C, 0), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(final_jr_troopa), BTL_POS_GROUND_C, 0), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(final_jr_troopa), BTL_POS_GROUND_C, 0), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kmr_03), "トゲクリボー(レクチャー)"), - BATTLE(N(Formation_01), N(kmr_03), "パタクリボー(レクチャー)"), - BATTLE(N(Formation_02), N(kmr_05), "コワッパ1"), - BATTLE(N(Formation_03), N(nok_01), "コワッパ2"), - BATTLE(N(Formation_04), N(mim_01), "コワッパ4"), - BATTLE(N(Formation_05), N(mac_01), "コワッパ5"), - BATTLE(N(Formation_06), N(sam_01), "コワッパ6"), - BATTLE(N(Formation_07), N(kpa_01), "コワッパ7"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kmr_03), "トゲクリボー(レクチャー)"), + BATTLE(A(Formation_01), A(kmr_03), "パタクリボー(レクチャー)"), + BATTLE(A(Formation_02), A(kmr_05b), "コワッパ1"), + BATTLE(A(Formation_03), A(nok_01), "コワッパ2"), + BATTLE(A(Formation_04), A(mim_01), "コワッパ4"), + BATTLE(A(Formation_05), A(mac_01), "コワッパ5"), + BATTLE(A(Formation_06), A(sam_01), "コワッパ6"), + BATTLE(A(Formation_07), A(kpa_13), "コワッパ7"), {}, }; -StageList N(Stages) = { - STAGE("kmr_02", N(kmr_02)), - STAGE("kmr_03", N(kmr_03)), - STAGE("kmr_04", N(kmr_04)), - STAGE("kmr_05", N(kmr_05)), - STAGE("kmr_06", N(kmr_06)), +StageList A(Stages) = { + STAGE("kmr_02", A(kmr_02)), + STAGE("kmr_03", A(kmr_03)), + STAGE("kmr_04", A(kmr_04)), + STAGE("kmr_05", A(kmr_05b)), + STAGE("kmr_06", A(kmr_06)), {}, }; diff --git a/src/battle/area/kmr_part_3/area.h b/src/battle/area/kmr_part_3/area.h new file mode 100644 index 0000000000..e922b1eace --- /dev/null +++ b/src/battle/area/kmr_part_3/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kmr_part_3 diff --git a/src/battle/area/kmr_part_3/stage/kmr_02.c b/src/battle/area/kmr_part_3/stage/kmr_02.c index 2adf1bd800..77d9023a8f 100644 --- a/src/battle/area/kmr_part_3/stage/kmr_02.c +++ b/src/battle/area/kmr_part_3/stage/kmr_02.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_3_kmr_02 - -#include "battle/common/stage/kmr_02.inc.c" +#include "battle/common/stage/area_kmr/kmr_02.inc.c" diff --git a/src/battle/area/kmr_part_3/stage/kmr_03.c b/src/battle/area/kmr_part_3/stage/kmr_03.c index f736f70474..db0b568e9b 100644 --- a/src/battle/area/kmr_part_3/stage/kmr_03.c +++ b/src/battle/area/kmr_part_3/stage/kmr_03.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_3_kmr_03 - -#include "battle/common/stage/kmr_03.inc.c" +#include "battle/common/stage/area_kmr/kmr_03.inc.c" diff --git a/src/battle/area/kmr_part_3/stage/kmr_04.c b/src/battle/area/kmr_part_3/stage/kmr_04.c index 0a47f2fba7..1d0ffbaa59 100644 --- a/src/battle/area/kmr_part_3/stage/kmr_04.c +++ b/src/battle/area/kmr_part_3/stage/kmr_04.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_3_kmr_04 - -#include "battle/common/stage/kmr_04.inc.c" +#include "battle/common/stage/area_kmr/kmr_04.inc.c" diff --git a/src/battle/area/kmr_part_3/stage/kmr_05b.c b/src/battle/area/kmr_part_3/stage/kmr_05b.c new file mode 100644 index 0000000000..9e2bcfb384 --- /dev/null +++ b/src/battle/area/kmr_part_3/stage/kmr_05b.c @@ -0,0 +1,3 @@ +#include "../area.h" + +#include "battle/common/stage/area_kmr/kmr_05b.inc.c" diff --git a/src/battle/area/kmr_part_3/stage/kmr_06.c b/src/battle/area/kmr_part_3/stage/kmr_06.c index 9a182c9e70..91f587accc 100644 --- a/src/battle/area/kmr_part_3/stage/kmr_06.c +++ b/src/battle/area/kmr_part_3/stage/kmr_06.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_3_kmr_06 - -#include "battle/common/stage/kmr_06.inc.c" +#include "battle/common/stage/area_kmr/kmr_06.inc.c" diff --git a/src/battle/area/kmr_part_3/stage/kpa_13.c b/src/battle/area/kmr_part_3/stage/kpa_13.c new file mode 100644 index 0000000000..c87a275dcd --- /dev/null +++ b/src/battle/area/kmr_part_3/stage/kpa_13.c @@ -0,0 +1,3 @@ +#include "../area.h" + +#include "battle/common/stage/area_kpa/kpa_13.inc.c" diff --git a/src/battle/area/kmr_part_3/stage/mac_01.c b/src/battle/area/kmr_part_3/stage/mac_01.c index cdeebd1d0d..dc8f11321e 100644 --- a/src/battle/area/kmr_part_3/stage/mac_01.c +++ b/src/battle/area/kmr_part_3/stage/mac_01.c @@ -1,43 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/mac_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_3_mac_01 - -#include "battle/common/stage/lib/WaterEffects.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SET(LVar0, MODEL_nami4) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_nami3) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_nami2) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_nami1) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_END_THREAD - EVT_SET(LVar0, MODEL_o391) - EVT_EXEC(N(EVS_AnimateFishModel)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "mac_tex", - .shape = "mac_bt01_shape", - .hit = "mac_bt01_hit", - .bg = "nok_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_mac/mac_01.inc.c" diff --git a/src/battle/area/kmr_part_3/stage/mim_01.c b/src/battle/area/kmr_part_3/stage/mim_01.c index 34a38d0c8f..b8dc9f7667 100644 --- a/src/battle/area/kmr_part_3/stage/mim_01.c +++ b/src/battle/area/kmr_part_3/stage/mim_01.c @@ -1,28 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/mim_bt01_shape.h" - -#define NAMESPACE b_area_kmr_part_3_mim_01 - -#include "common/UnkFogFunc2.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(N(UnkFogFunc2)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "mim_tex", - .shape = "mim_bt01_shape", - .hit = "mim_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "../area.h" +#include "battle/common/stage/area_mim/mim_01.inc.c" diff --git a/src/battle/area/kmr_part_3/stage/nok_01.c b/src/battle/area/kmr_part_3/stage/nok_01.c index ecc779e2c8..29cafe42c3 100644 --- a/src/battle/area/kmr_part_3/stage/nok_01.c +++ b/src/battle/area/kmr_part_3/stage/nok_01.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_3_nok_01 - -#include "battle/common/stage/nok_01.inc.c" +#include "battle/common/stage/area_nok/nok_01.inc.c" diff --git a/src/battle/area/kmr_part_3/stage/sam_01.c b/src/battle/area/kmr_part_3/stage/sam_01.c index 352b64d4b5..50f1c7433a 100644 --- a/src/battle/area/kmr_part_3/stage/sam_01.c +++ b/src/battle/area/kmr_part_3/stage/sam_01.c @@ -1,52 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/sam_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kmr_part_3_sam_01 - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_THREAD - EVT_SET(LVar0, MODEL_o262) - EVT_SET(LVar1, 1) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_o261) - EVT_SET(LVar1, 3) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_o260) - EVT_SET(LVar1, 4) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_o253) - EVT_SET(LVar1, 2) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_saku, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt01_shape", - .hit = "sam_bt01_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_01.inc.c" diff --git a/src/battle/area/kpa/actor/bony_beetle.c b/src/battle/area/kpa/actor/bony_beetle.c index 77c006f495..6918ca328f 100644 --- a/src/battle/area/kpa/actor/bony_beetle.c +++ b/src/battle/area/kpa/actor/bony_beetle.c @@ -1,1162 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/BonyBeetle.h" -#include "effects.h" - -#define NAMESPACE b_area_kpa_bony_beetle - -extern EvtScript N(init); -extern EvtScript N(idle); -extern EvtScript N(takeTurn); -extern EvtScript N(handleEvent); -extern EvtScript N(handleEvent_normal); -extern EvtScript N(handleEvent_spiky); -extern EvtScript N(handleEvent_flipped); -extern EvtScript N(handleEvent_spiky_flipped); -extern EvtScript N(changeSpikesState); -extern EvtScript N(attackShellToss); -extern EvtScript N(attackSpikeBounce); -extern EvtScript N(standUp); -extern EvtScript N(standUp_spiky); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -enum N(ActorVars) { - N(VAR_WAS_HIT) = 1, - N(VAR_STATE) = 8, - N(VAR_FLIP_TRIGGERED) = 9, -}; - -enum N(States) { - N(STATE_NORMAL) = 0, - N(STATE_SPIKY) = 1, - N(STATE_FLIPPED) = 2, - N(STATE_SPIKY_FLIPPED) = 3, -}; - -s32 N(IdleAnimations_normal)[] = { - STATUS_KEY_NORMAL, ANIM_BonyBeetle_Anim04, - STATUS_KEY_STONE, ANIM_BonyBeetle_Anim00, - STATUS_KEY_SLEEP, ANIM_BonyBeetle_Anim2A, - STATUS_KEY_POISON, ANIM_BonyBeetle_Anim04, - STATUS_KEY_STOP, ANIM_BonyBeetle_Anim00, - STATUS_KEY_STATIC, ANIM_BonyBeetle_Anim04, - STATUS_KEY_PARALYZE, ANIM_BonyBeetle_Anim00, - STATUS_KEY_DIZZY, ANIM_BonyBeetle_Anim26, - STATUS_KEY_FEAR, ANIM_BonyBeetle_Anim26, - STATUS_END, -}; - -s32 N(IdleAnimations_spiky)[] = { - STATUS_KEY_NORMAL, ANIM_BonyBeetle_Anim05, - STATUS_KEY_STONE, ANIM_BonyBeetle_Anim01, - STATUS_KEY_SLEEP, ANIM_BonyBeetle_Anim2B, - STATUS_KEY_POISON, ANIM_BonyBeetle_Anim05, - STATUS_KEY_STOP, ANIM_BonyBeetle_Anim01, - STATUS_KEY_STATIC, ANIM_BonyBeetle_Anim05, - STATUS_KEY_PARALYZE, ANIM_BonyBeetle_Anim01, - STATUS_KEY_DIZZY, ANIM_BonyBeetle_Anim27, - STATUS_KEY_FEAR, ANIM_BonyBeetle_Anim27, - STATUS_END, -}; - -s32 N(IdleAnimations_flipped)[] = { - STATUS_KEY_NORMAL, ANIM_BonyBeetle_Anim06, - STATUS_KEY_STONE, ANIM_BonyBeetle_Anim02, - STATUS_KEY_SLEEP, ANIM_BonyBeetle_Anim2C, - STATUS_KEY_POISON, ANIM_BonyBeetle_Anim06, - STATUS_KEY_STOP, ANIM_BonyBeetle_Anim02, - STATUS_KEY_STATIC, ANIM_BonyBeetle_Anim06, - STATUS_KEY_PARALYZE, ANIM_BonyBeetle_Anim02, - STATUS_KEY_DIZZY, ANIM_BonyBeetle_Anim28, - STATUS_KEY_FEAR, ANIM_BonyBeetle_Anim28, - STATUS_END, -}; - -s32 N(IdleAnimations_spiky_flipped)[] = { - STATUS_KEY_NORMAL, ANIM_BonyBeetle_Anim07, - STATUS_KEY_STONE, ANIM_BonyBeetle_Anim03, - STATUS_KEY_SLEEP, ANIM_BonyBeetle_Anim2D, - STATUS_KEY_POISON, ANIM_BonyBeetle_Anim07, - STATUS_KEY_STOP, ANIM_BonyBeetle_Anim03, - STATUS_KEY_STATIC, ANIM_BonyBeetle_Anim07, - STATUS_KEY_PARALYZE, ANIM_BonyBeetle_Anim03, - STATUS_KEY_DIZZY, ANIM_BonyBeetle_Anim29, - STATUS_KEY_FEAR, ANIM_BonyBeetle_Anim29, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 4, - ELEMENT_END, -}; - -s32 N(DefenseTable_Flipped)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 60, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 75, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 75, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 85, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, -1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, -1, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -3, 21 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_spiky), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_FLIPABLE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -8 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_BONY_BEETLE, - .level = 25, - .maxHP = 8, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 50, - .airLiftChance = 70, - .hurricaneChance = 60, - .spookChance = 60, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 90, - .coinReward = 1, - .size = { 27, 27 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(init) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_CALL(GetInstigatorValue, ACTOR_SELF, LVar1) - EVT_IF_EQ(LVar0, 1) - EVT_IF_EQ(LVar1, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim05) - EVT_ELSE - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_NORMAL)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_normal))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim04) - EVT_END_IF - EVT_ELSE - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 500) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_NORMAL)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_normal))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim04) - EVT_ELSE - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim05) - EVT_END_IF - EVT_END_IF -EVT_END_IF -EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) -EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) -EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE) -EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) -EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) -EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) -EVT_CALL(HPBarToHome, ACTOR_SELF) -EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 0) -EVT_RETURN -EVT_END -}; - -EvtScript N(idle) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(N(STATE_NORMAL)) - EVT_EXEC_WAIT(N(handleEvent_normal)) - EVT_CASE_EQ(N(STATE_SPIKY)) - EVT_EXEC_WAIT(N(handleEvent_spiky)) - EVT_CASE_EQ(N(STATE_FLIPPED)) - EVT_EXEC_WAIT(N(handleEvent_flipped)) - EVT_CASE_EQ(N(STATE_SPIKY_FLIPPED)) - EVT_EXEC_WAIT(N(handleEvent_spiky_flipped)) - EVT_END_SWITCH - EVT_CALL(ActorExists, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_EXEC_WAIT(N(changeSpikesState)) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 0) - EVT_END_IF - EVT_END_IF - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(changeSpikesState) = { - EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) - EVT_IF_LE(LVar0, 0) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_RETURN - EVT_END_IF - EVT_LABEL(0) - EVT_CALL(GetBattleFlags, LVarA) - EVT_IF_FLAG(LVarA, BS_FLAGS1_100) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(N(STATE_NORMAL)) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20CE) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY)) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim2E) - EVT_WAIT(25) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky))) - EVT_CASE_EQ(N(STATE_SPIKY)) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20CF) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_NORMAL)) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim2F) - EVT_WAIT(25) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_normal))) - EVT_CASE_EQ(N(STATE_FLIPPED)) - EVT_CASE_EQ(N(STATE_SPIKY_FLIPPED)) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(N(STATE_NORMAL)) - EVT_EXEC_WAIT(N(attackShellToss)) - EVT_CASE_EQ(N(STATE_SPIKY)) - EVT_EXEC_WAIT(N(attackSpikeBounce)) - EVT_CASE_EQ(N(STATE_FLIPPED)) - EVT_EXEC_WAIT(N(standUp)) - EVT_CASE_EQ(N(STATE_SPIKY_FLIPPED)) - EVT_EXEC_WAIT(N(standUp_spiky)) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -s32 N(FlipPosOffsets)[] = { 7, 13, 17, 21, 23, 24, 23, 21, 17, 13, 7, 0, 4, 6, 7, 6, 4, 0, 2, 0 }; - -EvtScript N(handleEvent_normal) = { - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1E) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim1F) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1E) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim1F) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1F) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_FLIPPED)) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim08) - EVT_USE_BUF(N(FlipPosOffsets)) - EVT_LOOP(20) - EVT_BUF_READ1(LVar0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_WAIT(20) - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim10) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_WAIT(20) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim12) - EVT_WAIT(10) - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0E) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(attackShellToss) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim16) - EVT_GOTO(100) - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim10) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(10) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(5) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim16) - EVT_WAIT(15) - EVT_LABEL(100) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D3) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim12) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim0E) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim04) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim12) - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim04) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_spiky) = { - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim20) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim21) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim20) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim21) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim21) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY_FLIPPED)) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky_flipped))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim09) - EVT_USE_BUF(N(FlipPosOffsets)) - EVT_LOOP(20) - EVT_BUF_READ1(LVar0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_WAIT(20) - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0F) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim11) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_WAIT(20) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim13) - EVT_END_IF - EVT_WAIT(10) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_SPIKE_TAUNT) - EVT_WAIT(10) - EVT_SET(LFlag0, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, -3) - EVT_ADD(LVar1, 10) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_IF_FLAG(LVar3, STATUS_FLAG_DIZZY) - EVT_ADD(LVar0, 0) - EVT_ADD(LVar1, 26) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_IF_EQ(LFlag0, FALSE) - EVT_ADD(LVar0, -8) - EVT_ADD(LVar1, 26) - EVT_END_IF - EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) - EVT_WAIT(20) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim05) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0F) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim19) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(attackSpikeBounce) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim17) - EVT_WAIT(10) - EVT_GOTO(100) - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim11) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(10) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 6, 0, 10, 0) - EVT_WAIT(5) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 8, 0, 10, 0) - EVT_WAIT(5) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 10, 0, 10, 0) - EVT_WAIT(5) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 12, 0, 10, 0) - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim17) - EVT_WAIT(15) - EVT_LABEL(100) - EVT_THREAD - EVT_LOOP(20) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_PLAY_EFFECT(EFFECT_WALKING_DUST, 0, LVar0, LVar1, LVar2, 0, 0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D3) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 5, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(24.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, 0) - EVT_LOOP(10) - EVT_ADD(LVar0, 18) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.5)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, 180) - EVT_LOOP(15) - EVT_ADD(LVar0, 12) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, 0) - EVT_LOOP(10) - EVT_ADD(LVar0, 18) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, 180) - EVT_LOOP(5) - EVT_ADD(LVar0, 18) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_WAIT(5) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0F) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(24.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, 0) - EVT_LOOP(10) - EVT_ADD(LVar0, 18) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.5)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 5, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, 180) - EVT_LOOP(15) - EVT_ADD(LVar0, 12) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, 0) - EVT_LOOP(10) - EVT_ADD(LVar0, 18) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - EVT_SET(LVar0, 180) - EVT_LOOP(5) - EVT_ADD(LVar0, 18) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_WAIT(5) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim13) - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0F) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(8021B7C8) = { - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_FLIPPED)) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim06) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar1, 24) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_301) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_flipped) = { - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim22) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim23) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim22) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim23) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim23) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_FLIPPED)) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1A) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) - EVT_USE_BUF(N(FlipPosOffsets)) - EVT_LOOP(20) - EVT_BUF_READ1(LVar0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_WAIT(20) - EVT_CASE_OR_EQ(EVENT_SCARE_AWAY) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(standUp) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), LVar0) - EVT_SUB(LVar0, 1) - EVT_IF_GT(LVar0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), LVar0) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1C) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim06) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_ELSE - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_15) - EVT_CALL(SetBattleCamZoom, 350) - EVT_CALL(SetBattleCamOffsetZ, 20) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1C) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim06) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim0A) - EVT_WAIT(20) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_NORMAL)) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_normal))) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_spiky_flipped) = { - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim24) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim25) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim24) - EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim25) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim25) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY_FLIPPED)) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky_flipped))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1B) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) - EVT_USE_BUF(N(FlipPosOffsets)) - EVT_LOOP(20) - EVT_BUF_READ1(LVar0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_WAIT(20) - EVT_CASE_OR_EQ(EVENT_SCARE_AWAY) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(standUp_spiky) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), LVar0) - EVT_SUB(LVar0, 1) - EVT_IF_GT(LVar0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), LVar0) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1D) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim07) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_ELSE - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_15) - EVT_CALL(SetBattleCamZoom, 350) - EVT_CALL(SetBattleCamOffsetZ, 20) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1D) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim07) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim0B) - EVT_WAIT(20) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY)) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "../area.h" +#include "battle/common/actor/bony_beetle.inc.c" diff --git a/src/battle/area/kpa/actor/dry_bones.c b/src/battle/area/kpa/actor/dry_bones.c index 65c8566833..cf950c40bc 100644 --- a/src/battle/area/kpa/actor/dry_bones.c +++ b/src/battle/area/kpa/actor/dry_bones.c @@ -1,549 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/DryBones.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_dry_bones - -extern EvtScript N(init); -extern EvtScript N(idle); -extern EvtScript N(takeTurn); -extern EvtScript N(handleEvent); -extern EvtScript N(nextTurn); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_DryBones_Anim02, - STATUS_KEY_STONE, ANIM_DryBones_Anim00, - STATUS_KEY_SLEEP, ANIM_DryBones_Anim0E, - STATUS_KEY_POISON, ANIM_DryBones_Anim02, - STATUS_KEY_STOP, ANIM_DryBones_Anim00, - STATUS_KEY_STATIC, ANIM_DryBones_Anim02, - STATUS_KEY_PARALYZE, ANIM_DryBones_Anim00, - STATUS_KEY_DIZZY, ANIM_DryBones_Anim0D, - STATUS_KEY_FEAR, ANIM_DryBones_Anim0D, - STATUS_END, -}; - -s32 N(IdleAnimations_dead)[] = { - STATUS_KEY_NORMAL, ANIM_DryBones_Anim01, - STATUS_END, -}; - -s32 N(IdleAnimations_bone)[] = { - STATUS_KEY_NORMAL, ANIM_DryBones_Anim0F, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 2, - ELEMENT_FIRE, -10, - ELEMENT_BLAST, -10, - ELEMENT_END, -}; - -s32 N(DefenseTable_dead)[] = { - ELEMENT_NORMAL, 99, - ELEMENT_FIRE, -10, - ELEMENT_BLAST, -10, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 0, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 0, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 50, - STATUS_KEY_SHRINK, 60, - STATUS_KEY_STOP, 85, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, -1, - STATUS_END, -}; - -s32 N(StatusTable_dead)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 0, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 0, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 0, - STATUS_KEY_SHRINK, 0, - STATUS_KEY_STOP, 0, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -8, 30 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 0 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_bone), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_DRY_BONES, - .level = 30, - .maxHP = 8, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 50, - .airLiftChance = 75, - .hurricaneChance = 70, - .spookChance = 10, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 95, - .coinReward = 1, - .size = { 28, 32 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -15, 15 }, - .statusTextOffset = { 3, 27 }, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn))) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(nextTurn) = { - EVT_CALL(GetOriginalActorType, ACTOR_SELF, LVarA) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetOriginalActorType, LVar0, LVar2) - EVT_IF_NE(LVar2, LVarA) - EVT_CALL(GetActorHP, LVar0, LVar3) - EVT_IF_NE(LVar3, 0) - EVT_RETURN - EVT_END_IF - EVT_END_IF - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(1) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetActorVar, LVar0, 8, LVar3) - EVT_IF_NE(LVar3, 1) - EVT_RETURN - EVT_END_IF - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(2) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(SetActorFlagBits, LVar0, ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(2) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_LABEL(0) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_SWITCH(LVar1) - EVT_CASE_FLAG(STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -6, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 1, -5) - EVT_CASE_DEFAULT - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -8, 30) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_END_SWITCH - EVT_CASE_EQ(1) - EVT_SWITCH(LVar1) - EVT_CASE_FLAG(STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -1, 10) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CASE_DEFAULT - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -1, 10) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_END_SWITCH - EVT_END_SWITCH - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(reassemble) = { - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim08) - EVT_WAIT(20) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_dead))) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_dead))) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_dead))) - EVT_CALL(ClearStatusEffects, ACTOR_SELF) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -1, 10) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(RandInt, 0, LVar0) - EVT_ADD(LVar0, 2) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, LVar0) - EVT_CALL(GetOriginalActorType, ACTOR_SELF, LVarA) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetOriginalActorType, LVar0, LVar2) - EVT_IF_NE(LVar2, LVarA) - EVT_RETURN - EVT_END_IF - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(1) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetActorVar, LVar0, 8, LVar3) - EVT_IF_NE(LVar3, 1) - EVT_RETURN - EVT_END_IF - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(2) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(SetActorFlagBits, LVar0, ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(2) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim0B) - EVT_SET_CONST(LVar2, ANIM_DryBones_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim0B) - EVT_SET_CONST(LVar2, ANIM_DryBones_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_EXEC_WAIT(N(reassemble)) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_WAIT(10) - EVT_EXEC_WAIT(N(reassemble)) - EVT_END_IF - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_END_IF - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim04) - EVT_SET_CONST(LVar2, ANIM_DryBones_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_END_IF - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, -1, -2, 0) - EVT_ELSE - EVT_CALL(SetActorDispOffset, ACTOR_SELF, -3, -5, 0) - EVT_END_IF - EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim02) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_DryBones_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_IF - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(rotateBone) = { - EVT_SET(LVar0, 0) - EVT_LABEL(0) - EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_2, 0, 0, LVar0) - EVT_ADD(LVar0, 60) - EVT_MOD(LVar0, 360) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 1) - EVT_END_IF - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim06) - EVT_GOTO(100) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SUB(LVar0, 1) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim09) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D3) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim0A) - EVT_WAIT(20) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable))) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_2000, FALSE) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -8, 30) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(GetEnemyMaxHP, ACTOR_SELF, LVar0) - EVT_CALL(SetEnemyHP, ACTOR_SELF, LVar0) - EVT_ELSE - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim09) - EVT_WAIT(10) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, LVar0) - EVT_END_IF - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim05) - EVT_WAIT(15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim06) - EVT_THREAD - EVT_WAIT(8) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim02) - EVT_END_THREAD - EVT_LABEL(100) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) - EVT_ELSE - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_END_IF - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarF, LVar0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 20) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_2, SOUND_2D1) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_WALK, 0, 0) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) - EVT_EXEC_GET_TID(N(rotateBone), LVarA) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 100) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_2, EVT_FLOAT(12.0)) - EVT_CALL(RunPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_KILL_THREAD(LVarA) - EVT_IF_EQ(LVarF, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(15) - EVT_CALL(YieldTurn) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_WAIT(20) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 20) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_2, SOUND_2D1) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_WALK, 0, 0) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) - EVT_EXEC_GET_TID(N(rotateBone), LVarA) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_2, EVT_FLOAT(12.0)) - EVT_CALL(RunPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 100) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(0.7)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 30, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_KILL_THREAD(LVarA) - EVT_CALL(YieldTurn) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/dry_bones.inc.c" diff --git a/src/battle/area/kpa/actor/ember.c b/src/battle/area/kpa/actor/ember.c index 08d0b03334..27a5b7574b 100644 --- a/src/battle/area/kpa/actor/ember.c +++ b/src/battle/area/kpa/actor/ember.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kpa_ember +#include "../area.h" #include "battle/common/actor/ember.inc.c" diff --git a/src/battle/area/kpa/actor/hammer_bro.c b/src/battle/area/kpa/actor/hammer_bro.c index a745d8fc81..5fb167f0e5 100644 --- a/src/battle/area/kpa/actor/hammer_bro.c +++ b/src/battle/area/kpa/actor/hammer_bro.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kpa_hammer_bro +#include "../area.h" #include "battle/common/actor/hammer_bro.inc.c" diff --git a/src/battle/area/kpa/actor/koopatrol.c b/src/battle/area/kpa/actor/koopatrol.c index e4fe1100dd..25c356920f 100644 --- a/src/battle/area/kpa/actor/koopatrol.c +++ b/src/battle/area/kpa/actor/koopatrol.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kpa_koopatrol +#include "../area.h" #include "battle/common/actor/koopatrol.inc.c" diff --git a/src/battle/area/kpa/actor/magikoopa.c b/src/battle/area/kpa/actor/magikoopa.c index 11fa6c54c8..20f3a00bd6 100644 --- a/src/battle/area/kpa/actor/magikoopa.c +++ b/src/battle/area/kpa/actor/magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kpa_magikoopa +#include "../area.h" #include "battle/common/actor/magikoopa.inc.c" diff --git a/src/battle/area/kpa/area.c b/src/battle/area/kpa/area.c index 526ba0bd8d..a7598f115f 100644 --- a/src/battle/area/kpa/area.c +++ b/src/battle/area/kpa/area.c @@ -1,463 +1,460 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_kpa +extern ActorBlueprint A(bony_beetle); +extern ActorBlueprint A(dry_bones); +extern ActorBlueprint A(magikoopa); +extern ActorBlueprint A(magikoopa_flying); +extern ActorBlueprint A(ember); +extern ActorBlueprint A(koopatrol); +extern ActorBlueprint A(hammer_bro); -extern ActorBlueprint N(bony_beetle); -extern ActorBlueprint N(dry_bones); -extern ActorBlueprint N(magikoopa); -extern ActorBlueprint N(magikoopa_flying); -extern ActorBlueprint N(ember); -extern ActorBlueprint N(koopatrol); -extern ActorBlueprint N(hammer_bro); +extern Stage A(kpa_01); +extern Stage A(kpa_01b); +extern Stage A(kpa_02); +extern Stage A(kpa_03); +extern Stage A(kpa_04); +extern Stage A(kpa_04b); +extern Stage A(kpa_04c); +extern Stage A(kpa_05); +extern Stage A(kpa_07); +extern Stage A(kpa_08); +extern Stage A(kpa_09); +extern Stage A(kpa_11); +extern Stage A(kpa_13); +extern Stage A(kpa_14); -extern Stage N(kpa_01); -extern Stage N(kpa_01b); -extern Stage N(kpa_02); -extern Stage N(kpa_03); -extern Stage N(kpa_04); -extern Stage N(kpa_04b); -extern Stage N(kpa_04c); -extern Stage N(kpa_05); -extern Stage N(kpa_07); -extern Stage N(kpa_08); -extern Stage N(kpa_09); -extern Stage N(kpa_11); -extern Stage N(kpa_13); -extern Stage N(kpa_14); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_B, 10, 1), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_B, 10, 1), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_A, 10, 1), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 8), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_A, 10, 1), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_A, 10, 1), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_C, 8), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_A, 10, 1), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_A, 10, 1), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_C, 8), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_A, 10, 1), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_A, 10, 1), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_A, 10, 1), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_A, 10, 1), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_A, 10, 1), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_A, 10, 1), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_A, 10, 1), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_C, 9), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_C, 8), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_D, 7), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(ember), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(ember), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(ember), BTL_POS_GROUND_D, 7), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(ember), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(ember), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(ember), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 8), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_D, 7), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_C, 9), +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_C, 8), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_11) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 9), +Formation A(Formation_11) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_12) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), +Formation A(Formation_12) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_13) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), +Formation A(Formation_13) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_14) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_D, 9), +Formation A(Formation_14) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_D, 9), }; -Formation N(Formation_15) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_C, 8), +Formation A(Formation_15) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_C, 8), }; -Formation N(Formation_16) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_D, 9), +Formation A(Formation_16) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_D, 9), }; -Formation N(Formation_17) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 10), +Formation A(Formation_17) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_18) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 9), +Formation A(Formation_18) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_19) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), +Formation A(Formation_19) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_1A) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_D, 7), +Formation A(Formation_1A) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_1B) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_C, 9), +Formation A(Formation_1B) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_1C) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_D, 7), +Formation A(Formation_1C) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_D, 7), }; -Vec3i N(Formation_1D_pos1) = { 5, 0, -20 }; +Vec3i A(Formation_1D_pos1) = { 5, 0, -20 }; -Vec3i N(Formation_1D_pos2) = { 45, 0, -10 }; +Vec3i A(Formation_1D_pos2) = { 45, 0, -10 }; -Vec3i N(Formation_1D_pos3) = { 85, 0, 0 }; +Vec3i A(Formation_1D_pos3) = { 85, 0, 0 }; -Vec3i N(Formation_1D_pos4) = { 125, 0, 5 }; +Vec3i A(Formation_1D_pos4) = { 125, 0, 5 }; -Formation N(Formation_1D) = { - ACTOR_BY_POS(N(koopatrol), N(Formation_1D_pos1), 10), - ACTOR_BY_POS(N(koopatrol), N(Formation_1D_pos2), 9), - ACTOR_BY_POS(N(koopatrol), N(Formation_1D_pos3), 8), - ACTOR_BY_POS(N(magikoopa), N(Formation_1D_pos4), 7), +Formation A(Formation_1D) = { + ACTOR_BY_POS(A(koopatrol), A(Formation_1D_pos1), 10), + ACTOR_BY_POS(A(koopatrol), A(Formation_1D_pos2), 9), + ACTOR_BY_POS(A(koopatrol), A(Formation_1D_pos3), 8), + ACTOR_BY_POS(A(magikoopa), A(Formation_1D_pos4), 7), }; -Formation N(Formation_1E) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_1E) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_1F) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_1F) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_20) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 9), +Formation A(Formation_20) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_21) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 8), +Formation A(Formation_21) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_22) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 8), +Formation A(Formation_22) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_23) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), +Formation A(Formation_23) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_24) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_C, 8), +Formation A(Formation_24) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_25) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_D, 7), +Formation A(Formation_25) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_D, 7), }; -Formation N(Formation_26) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_26) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_27) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_C, 9), +Formation A(Formation_27) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_28) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_28) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_29) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_C, 8), +Formation A(Formation_29) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_C, 8), }; -Formation N(Formation_2A) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_D, 7), +Formation A(Formation_2A) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_D, 7), }; -Formation N(Formation_2B) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_D, 7), +Formation A(Formation_2B) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_2C) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_C, 8), +Formation A(Formation_2C) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_2D) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_2D) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_2E) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bony_beetle), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_2E) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bony_beetle), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_2F) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_C, 8), +Formation A(Formation_2F) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_C, 8), }; -Formation N(Formation_30) = { - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_D, 7), +Formation A(Formation_30) = { + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_31) = { - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_C, 9), +Formation A(Formation_31) = { + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_C, 9), }; -Formation N(Formation_32) = { - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_C, 8), +Formation A(Formation_32) = { + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_C, 8), }; -Formation N(Formation_33) = { - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_33) = { + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_34) = { - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 8), +Formation A(Formation_34) = { + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_35) = { - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_C, 9), +Formation A(Formation_35) = { + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_36) = { - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dry_bones), BTL_POS_GROUND_C, 8), +Formation A(Formation_36) = { + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dry_bones), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_37) = { - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_C, 9), +Formation A(Formation_37) = { + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_C, 9), }; -Formation N(Formation_38) = { - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(magikoopa_flying), BTL_POS_AIR_D, 7), +Formation A(Formation_38) = { + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(magikoopa_flying), BTL_POS_AIR_D, 7), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kpa_01), "ホネメットx2"), - BATTLE(N(Formation_01), N(kpa_01), "ホネメットx3"), - BATTLE(N(Formation_02), N(kpa_01), "ホネメット,カロンx2"), - BATTLE(N(Formation_03), N(kpa_01), "ホネメットx2,カロン"), - BATTLE(N(Formation_04), N(kpa_01), "ホネメットx2,カメック"), - BATTLE(N(Formation_05), N(kpa_01), "ホネメットx3,カメック"), - BATTLE(N(Formation_06), N(kpa_01), "ホネメット,カロン,ホネメット,カメック"), - BATTLE(N(Formation_07), N(kpa_01), "カロンx2"), - BATTLE(N(Formation_08), N(kpa_01), "カロンx3"), - BATTLE(N(Formation_09), N(kpa_01), "カロンx4"), - BATTLE(N(Formation_0A), N(kpa_01), "カロン,エルモスx3"), - BATTLE(N(Formation_0B), N(kpa_01), "カロンx2,カメック"), - BATTLE(N(Formation_0C), N(kpa_01), "カロン,トゲノコx2"), - BATTLE(N(Formation_0D), N(kpa_01), "カロンx2,ホネメット"), - BATTLE(N(Formation_0E), N(kpa_01), "カロンx2,ホネメットx2"), - BATTLE(N(Formation_0F), N(kpa_01), "ハンマーブロスx2"), - BATTLE(N(Formation_10), N(kpa_01), "ハンマーブロスx3"), - BATTLE(N(Formation_11), N(kpa_01), "ハンマーブロス,トゲノコ"), - BATTLE(N(Formation_12), N(kpa_01), "ハンマーブロスx2,トゲノコ"), - BATTLE(N(Formation_13), N(kpa_01), "ハンマーブロス,トゲノコx2"), - BATTLE(N(Formation_14), N(kpa_01), "ハンマーブロス,カロン,ハンンマーブロス,カメック"), - BATTLE(N(Formation_15), N(kpa_01), "ハンマーブロスx2,くうちゅうカメック"), - BATTLE(N(Formation_16), N(kpa_01), "ハンマーブロスx3,くうちゅうカメック"), - BATTLE(N(Formation_17), N(kpa_01), "トゲノコ"), - BATTLE(N(Formation_18), N(kpa_01), "トゲノコx2"), - BATTLE(N(Formation_19), N(kpa_01), "トゲノコx3"), - BATTLE(N(Formation_1A), N(kpa_01), "トゲノコx4"), - BATTLE(N(Formation_1B), N(kpa_01), "トゲノコ,ハンマーブロス"), - BATTLE(N(Formation_1C), N(kpa_01), "トゲノコ,ハンマーブロス,トゲノコ,ハンマーブロス"), - BATTLE(N(Formation_1D), N(kpa_01), "トゲノコx3,カメック"), - BATTLE(N(Formation_1E), N(kpa_01), "トゲノコx2,カメックx2"), - BATTLE(N(Formation_20), N(kpa_01), "トゲノコ,ホネメット"), - BATTLE(N(Formation_21), N(kpa_01), "トゲノコx2,ホネメット"), - BATTLE(N(Formation_22), N(kpa_01), "トゲノコ,ホネメットx2"), - BATTLE(N(Formation_23), N(kpa_01), "トゲノコ,ホネメット,トゲノコ"), - BATTLE(N(Formation_24), N(kpa_01), "トゲノコ,カロンx2"), - BATTLE(N(Formation_25), N(kpa_01), "トゲノコx2,カメック,くうちゅうカメック"), - BATTLE(N(Formation_26), N(kpa_01), "トゲノコ,カメック,トゲノコ,カメック"), - BATTLE(N(Formation_27), N(kpa_01), "カメックx2"), - BATTLE(N(Formation_28), N(kpa_01), "カメックx3"), - BATTLE(N(Formation_29), N(kpa_01), "カメック,くうちゅうカメックx2"), - BATTLE(N(Formation_2A), N(kpa_01), "カメックx2,くうちゅうカメックx2"), - BATTLE(N(Formation_2B), N(kpa_01), "カメック,トゲノコx3"), - BATTLE(N(Formation_2C), N(kpa_01), "カメックx2,カロン"), - BATTLE(N(Formation_2D), N(kpa_01), "カメック,ホネメット,カメック"), - BATTLE(N(Formation_2E), N(kpa_01), "カメック,ホネメットx2,カメック"), - BATTLE(N(Formation_2F), N(kpa_01), "カメックx2,くうちゅうカメック"), - BATTLE(N(Formation_30), N(kpa_01), "カメック,トゲノコ,カメック,トゲノコ"), - BATTLE(N(Formation_31), N(kpa_01), "くうちゅうカメックx2"), - BATTLE(N(Formation_32), N(kpa_01), "くうちゅうカメックx3"), - BATTLE(N(Formation_33), N(kpa_01), "くうちゅうカメック,カメック,くうちゅうカメック,カメック"), - BATTLE(N(Formation_34), N(kpa_01), "くうちゅうカメック,トゲノコx2"), - BATTLE(N(Formation_35), N(kpa_01), "くうちゅうカメック,ハンマーブロス"), - BATTLE(N(Formation_36), N(kpa_01), "くうちゅうカメック,カロンx2"), - BATTLE(N(Formation_37), N(kpa_01), "くうちゅうカメック,トゲノコ,くうちゅうカメック"), - BATTLE(N(Formation_38), N(kpa_01), "くうちゅうカメック,ハンマーブロスx2,くうちゅうカメック"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kpa_01), "ホネメットx2"), + BATTLE(A(Formation_01), A(kpa_01), "ホネメットx3"), + BATTLE(A(Formation_02), A(kpa_01), "ホネメット,カロンx2"), + BATTLE(A(Formation_03), A(kpa_01), "ホネメットx2,カロン"), + BATTLE(A(Formation_04), A(kpa_01), "ホネメットx2,カメック"), + BATTLE(A(Formation_05), A(kpa_01), "ホネメットx3,カメック"), + BATTLE(A(Formation_06), A(kpa_01), "ホネメット,カロン,ホネメット,カメック"), + BATTLE(A(Formation_07), A(kpa_01), "カロンx2"), + BATTLE(A(Formation_08), A(kpa_01), "カロンx3"), + BATTLE(A(Formation_09), A(kpa_01), "カロンx4"), + BATTLE(A(Formation_0A), A(kpa_01), "カロン,エルモスx3"), + BATTLE(A(Formation_0B), A(kpa_01), "カロンx2,カメック"), + BATTLE(A(Formation_0C), A(kpa_01), "カロン,トゲノコx2"), + BATTLE(A(Formation_0D), A(kpa_01), "カロンx2,ホネメット"), + BATTLE(A(Formation_0E), A(kpa_01), "カロンx2,ホネメットx2"), + BATTLE(A(Formation_0F), A(kpa_01), "ハンマーブロスx2"), + BATTLE(A(Formation_10), A(kpa_01), "ハンマーブロスx3"), + BATTLE(A(Formation_11), A(kpa_01), "ハンマーブロス,トゲノコ"), + BATTLE(A(Formation_12), A(kpa_01), "ハンマーブロスx2,トゲノコ"), + BATTLE(A(Formation_13), A(kpa_01), "ハンマーブロス,トゲノコx2"), + BATTLE(A(Formation_14), A(kpa_01), "ハンマーブロス,カロン,ハンンマーブロス,カメック"), + BATTLE(A(Formation_15), A(kpa_01), "ハンマーブロスx2,くうちゅうカメック"), + BATTLE(A(Formation_16), A(kpa_01), "ハンマーブロスx3,くうちゅうカメック"), + BATTLE(A(Formation_17), A(kpa_01), "トゲノコ"), + BATTLE(A(Formation_18), A(kpa_01), "トゲノコx2"), + BATTLE(A(Formation_19), A(kpa_01), "トゲノコx3"), + BATTLE(A(Formation_1A), A(kpa_01), "トゲノコx4"), + BATTLE(A(Formation_1B), A(kpa_01), "トゲノコ,ハンマーブロス"), + BATTLE(A(Formation_1C), A(kpa_01), "トゲノコ,ハンマーブロス,トゲノコ,ハンマーブロス"), + BATTLE(A(Formation_1D), A(kpa_01), "トゲノコx3,カメック"), + BATTLE(A(Formation_1E), A(kpa_01), "トゲノコx2,カメックx2"), + BATTLE(A(Formation_20), A(kpa_01), "トゲノコ,ホネメット"), + BATTLE(A(Formation_21), A(kpa_01), "トゲノコx2,ホネメット"), + BATTLE(A(Formation_22), A(kpa_01), "トゲノコ,ホネメットx2"), + BATTLE(A(Formation_23), A(kpa_01), "トゲノコ,ホネメット,トゲノコ"), + BATTLE(A(Formation_24), A(kpa_01), "トゲノコ,カロンx2"), + BATTLE(A(Formation_25), A(kpa_01), "トゲノコx2,カメック,くうちゅうカメック"), + BATTLE(A(Formation_26), A(kpa_01), "トゲノコ,カメック,トゲノコ,カメック"), + BATTLE(A(Formation_27), A(kpa_01), "カメックx2"), + BATTLE(A(Formation_28), A(kpa_01), "カメックx3"), + BATTLE(A(Formation_29), A(kpa_01), "カメック,くうちゅうカメックx2"), + BATTLE(A(Formation_2A), A(kpa_01), "カメックx2,くうちゅうカメックx2"), + BATTLE(A(Formation_2B), A(kpa_01), "カメック,トゲノコx3"), + BATTLE(A(Formation_2C), A(kpa_01), "カメックx2,カロン"), + BATTLE(A(Formation_2D), A(kpa_01), "カメック,ホネメット,カメック"), + BATTLE(A(Formation_2E), A(kpa_01), "カメック,ホネメットx2,カメック"), + BATTLE(A(Formation_2F), A(kpa_01), "カメックx2,くうちゅうカメック"), + BATTLE(A(Formation_30), A(kpa_01), "カメック,トゲノコ,カメック,トゲノコ"), + BATTLE(A(Formation_31), A(kpa_01), "くうちゅうカメックx2"), + BATTLE(A(Formation_32), A(kpa_01), "くうちゅうカメックx3"), + BATTLE(A(Formation_33), A(kpa_01), "くうちゅうカメック,カメック,くうちゅうカメック,カメック"), + BATTLE(A(Formation_34), A(kpa_01), "くうちゅうカメック,トゲノコx2"), + BATTLE(A(Formation_35), A(kpa_01), "くうちゅうカメック,ハンマーブロス"), + BATTLE(A(Formation_36), A(kpa_01), "くうちゅうカメック,カロンx2"), + BATTLE(A(Formation_37), A(kpa_01), "くうちゅうカメック,トゲノコ,くうちゅうカメック"), + BATTLE(A(Formation_38), A(kpa_01), "くうちゅうカメック,ハンマーブロスx2,くうちゅうカメック"), {}, }; -StageList N(Stages) = { - STAGE("kpa_01", N(kpa_01)), - STAGE("kpa_01b", N(kpa_01b)), - STAGE("kpa_02", N(kpa_02)), - STAGE("kpa_03", N(kpa_03)), - STAGE("kpa_04", N(kpa_04)), - STAGE("kpa_04b", N(kpa_04b)), - STAGE("kpa_04c", N(kpa_04c)), - STAGE("kpa_05", N(kpa_05)), - STAGE("kpa_07", N(kpa_07)), - STAGE("kpa_08", N(kpa_08)), - STAGE("kpa_09", N(kpa_09)), - STAGE("kpa_11", N(kpa_11)), - STAGE("kpa_13", N(kpa_13)), - STAGE("kpa_14", N(kpa_14)), +StageList A(Stages) = { + STAGE("kpa_01", A(kpa_01)), + STAGE("kpa_01b", A(kpa_01b)), + STAGE("kpa_02", A(kpa_02)), + STAGE("kpa_03", A(kpa_03)), + STAGE("kpa_04", A(kpa_04)), + STAGE("kpa_04b", A(kpa_04b)), + STAGE("kpa_04c", A(kpa_04c)), + STAGE("kpa_05", A(kpa_05)), + STAGE("kpa_07", A(kpa_07)), + STAGE("kpa_08", A(kpa_08)), + STAGE("kpa_09", A(kpa_09)), + STAGE("kpa_11", A(kpa_11)), + STAGE("kpa_13", A(kpa_13)), + STAGE("kpa_14", A(kpa_14)), {}, }; diff --git a/src/battle/area/kpa/area.h b/src/battle/area/kpa/area.h new file mode 100644 index 0000000000..01b543c527 --- /dev/null +++ b/src/battle/area/kpa/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kpa diff --git a/src/battle/area/kpa/stage/kpa_01.c b/src/battle/area/kpa/stage/kpa_01.c index 099f3ec2a1..09e1d57642 100644 --- a/src/battle/area/kpa/stage/kpa_01.c +++ b/src/battle/area/kpa/stage/kpa_01.c @@ -1,56 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_01 - -EvtScript N(8022EFE0) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 36, MODEL_GROUP_HIDDEN) - EVT_THREAD - EVT_SET(LVar0, 37) - EVT_EXEC(N(8022EFE0)) - EVT_WAIT(5) - EVT_SET(LVar0, 39) - EVT_EXEC(N(8022EFE0)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o382, - MODEL_o381, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt01_shape", - .hit = "kpa_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_01.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_01b.c b/src/battle/area/kpa/stage/kpa_01b.c index ab2cdce74b..b6217f6908 100644 --- a/src/battle/area/kpa/stage/kpa_01b.c +++ b/src/battle/area/kpa/stage/kpa_01b.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_01b - -EvtScript N(8022F180) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 25, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 37) - EVT_EXEC(N(8022F180)) - EVT_SET(LVar0, 39) - EVT_EXEC(N(8022F180)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o382, - MODEL_o381, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt01_shape", - .hit = "kpa_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_01b.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_02.c b/src/battle/area/kpa/stage/kpa_02.c index 2a658f7c00..be987f0fbc 100644 --- a/src/battle/area/kpa/stage/kpa_02.c +++ b/src/battle/area/kpa/stage/kpa_02.c @@ -1,104 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_02 - -EvtScript N(8022F300) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022F3D0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022F4BC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 16) - EVT_SET(LVar1, 1) - EVT_SET(LVar2, -400) - EVT_SET(LVar3, -800) - EVT_EXEC(N(8022F3D0)) - EVT_SET(LVar0, 19) - EVT_SET(LVar1, 3) - EVT_SET(LVar2, -400) - EVT_SET(LVar3, -800) - EVT_EXEC(N(8022F3D0)) - EVT_SET(LVar0, 17) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, -400) - EVT_SET(LVar3, -800) - EVT_EXEC(N(8022F4BC)) - EVT_SET(LVar0, 18) - EVT_SET(LVar1, 2) - EVT_SET(LVar2, -400) - EVT_SET(LVar3, -800) - EVT_EXEC(N(8022F4BC)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_saku, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt02_shape", - .hit = "kpa_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_02.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_03.c b/src/battle/area/kpa/stage/kpa_03.c index 8e3ed47d28..3ea4b2a6ee 100644 --- a/src/battle/area/kpa/stage/kpa_03.c +++ b/src/battle/area/kpa/stage/kpa_03.c @@ -1,33 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/kpa_bt03_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_03 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetDarknessMode, BTL_DARKNESS_MODE_1) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_tar1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt03_shape", - .hit = "kpa_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_03.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_04.c b/src/battle/area/kpa/stage/kpa_04.c index 461e4811c4..aea703f078 100644 --- a/src/battle/area/kpa/stage/kpa_04.c +++ b/src/battle/area/kpa/stage/kpa_04.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_04 - -EvtScript N(8022F7F0) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 15, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 17, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 16, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 26, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 18, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 20, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 22, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 24, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 32) - EVT_EXEC(N(8022F7F0)) - EVT_SET(LVar0, 34) - EVT_EXEC(N(8022F7F0)) - EVT_SET(LVar0, 36) - EVT_EXEC(N(8022F7F0)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt04_shape", - .hit = "kpa_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_04.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_04b.c b/src/battle/area/kpa/stage/kpa_04b.c index d47da69eae..fec75f8773 100644 --- a/src/battle/area/kpa/stage/kpa_04b.c +++ b/src/battle/area/kpa/stage/kpa_04b.c @@ -1,52 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_04b - -EvtScript N(8022FA10) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 13, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 17, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 16, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 18, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 20, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 22, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 24, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 32) - EVT_EXEC(N(8022FA10)) - EVT_SET(LVar0, 34) - EVT_EXEC(N(8022FA10)) - EVT_SET(LVar0, 36) - EVT_EXEC(N(8022FA10)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt04_shape", - .hit = "kpa_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_04b.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_04c.c b/src/battle/area/kpa/stage/kpa_04c.c index 21c3a5682a..9a5d9887df 100644 --- a/src/battle/area/kpa/stage/kpa_04c.c +++ b/src/battle/area/kpa/stage/kpa_04c.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_04c - -EvtScript N(8022FC20) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 30, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 39, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 38, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 36, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 34, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 32, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 18) - EVT_EXEC(N(8022FC20)) - EVT_SET(LVar0, 20) - EVT_EXEC(N(8022FC20)) - EVT_SET(LVar0, 22) - EVT_EXEC(N(8022FC20)) - EVT_SET(LVar0, 24) - EVT_EXEC(N(8022FC20)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt04_shape", - .hit = "kpa_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_04c.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_05.c b/src/battle/area/kpa/stage/kpa_05.c index 3c3caab48e..8719a430e3 100644 --- a/src/battle/area/kpa/stage/kpa_05.c +++ b/src/battle/area/kpa/stage/kpa_05.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt05_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_05 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_saku, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt05_shape", - .hit = "kpa_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_05.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_07.c b/src/battle/area/kpa/stage/kpa_07.c index 23c34596fe..d3db812594 100644 --- a/src/battle/area/kpa/stage/kpa_07.c +++ b/src/battle/area/kpa/stage/kpa_07.c @@ -1,99 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt07_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_07 - -EvtScript N(8022FEB0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022FF80) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8023006C) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 16) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, -200) - EVT_SET(LVar3, 0) - EVT_EXEC(N(8022FEB0)) - EVT_SET(LVar0, 17) - EVT_SET(LVar1, 1) - EVT_SET(LVar2, -120) - EVT_SET(LVar3, 0) - EVT_EXEC(N(8022FEB0)) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 2) - EVT_SET(LVar2, -100) - EVT_SET(LVar3, 0) - EVT_EXEC(N(8022FEB0)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_kemu1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt07_shape", - .hit = "kpa_bt07_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_07.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_08.c b/src/battle/area/kpa/stage/kpa_08.c index 6b8fb0af00..8b5a6e1d80 100644 --- a/src/battle/area/kpa/stage/kpa_08.c +++ b/src/battle/area/kpa/stage/kpa_08.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt08_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_08 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o478, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt08_shape", - .hit = "kpa_bt08_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_08.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_09.c b/src/battle/area/kpa/stage/kpa_09.c index 2475424531..3a4f4f3bd8 100644 --- a/src/battle/area/kpa/stage/kpa_09.c +++ b/src/battle/area/kpa/stage/kpa_09.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt09_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_09 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o353, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt09_shape", - .hit = "kpa_bt09_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_09.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_11.c b/src/battle/area/kpa/stage/kpa_11.c index ad4a2d5c47..263100c5f3 100644 --- a/src/battle/area/kpa/stage/kpa_11.c +++ b/src/battle/area/kpa/stage/kpa_11.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt11_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_11 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_h2, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt11_shape", - .hit = "kpa_bt11_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_11.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_13.c b/src/battle/area/kpa/stage/kpa_13.c index 0ede990c7a..c87a275dcd 100644 --- a/src/battle/area/kpa/stage/kpa_13.c +++ b/src/battle/area/kpa/stage/kpa_13.c @@ -1,39 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_13 - -EvtScript N(80230440) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt13_shape", - .hit = "kpa_bt13_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_13.inc.c" diff --git a/src/battle/area/kpa/stage/kpa_14.c b/src/battle/area/kpa/stage/kpa_14.c index 99e72542bb..df348b13ec 100644 --- a/src/battle/area/kpa/stage/kpa_14.c +++ b/src/battle/area/kpa/stage/kpa_14.c @@ -1,39 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa_kpa_14 - -EvtScript N(80230570) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt14_shape", - .hit = "kpa_bt14_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_14.inc.c" diff --git a/src/battle/area/kpa2/actor/bowser.c b/src/battle/area/kpa2/actor/bowser.c index 0e785ad7ac..4a3f50c168 100644 --- a/src/battle/area/kpa2/actor/bowser.c +++ b/src/battle/area/kpa2/actor/bowser.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BattleBowser.h" -#include "effects.h" -#define NAMESPACE b_area_kpa2_bowser +#define NAMESPACE A(bowser) extern EvtScript N(init); extern EvtScript N(idle); @@ -157,7 +154,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CASE_EQ(EVENT_SHOCK_DEATH) @@ -176,11 +173,11 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -195,16 +192,16 @@ EvtScript N(handleEvent) = { }; EvtScript N(onHit) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_RETURN EVT_END }; EvtScript N(onDeath) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END diff --git a/src/battle/area/kpa2/actor/bowser_intro.c b/src/battle/area/kpa2/actor/bowser_intro.c index e28674b989..d7398e8982 100644 --- a/src/battle/area/kpa2/actor/bowser_intro.c +++ b/src/battle/area/kpa2/actor/bowser_intro.c @@ -1,12 +1,9 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" +#include "sprite.h" #include "sprite/npc/BattleBowser.h" #include "sprite/npc/ParadePeach.h" -#include "effects.h" -#include "sprite.h" -#define NAMESPACE b_area_kpa2_bowser_intro +#define NAMESPACE A(bowser_intro) extern EvtScript N(init); extern EvtScript N(idle); @@ -248,7 +245,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CASE_EQ(EVENT_SHOCK_DEATH) @@ -257,7 +254,7 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET(LVar1, ANIM_BattleBowser_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_TURN_COUNTER), LVar0) @@ -272,13 +269,13 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Jump) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleBowser_PostJump) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 4, EVT_FLOAT(3.0)) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -293,16 +290,16 @@ EvtScript N(handleEvent) = { }; EvtScript N(onHit) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_RETURN EVT_END }; EvtScript N(onDeath) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END diff --git a/src/battle/area/kpa2/actor/bowser_phase_1.c b/src/battle/area/kpa2/actor/bowser_phase_1.c index a75357ba1b..d933fc33de 100644 --- a/src/battle/area/kpa2/actor/bowser_phase_1.c +++ b/src/battle/area/kpa2/actor/bowser_phase_1.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BattleBowser.h" -#include "effects.h" -#define NAMESPACE b_area_kpa2_bowser_phase_1 +#define NAMESPACE A(bowser_phase_1) extern EvtScript N(init); extern EvtScript N(idle); @@ -258,7 +255,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_DEATH) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(onHit)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -291,7 +288,7 @@ EvtScript N(handleEvent) = { EVT_SET(LVar1, ANIM_BattleBowser_BurnHurt) EVT_SET(LVar2, ANIM_BattleBowser_BurnStill) EVT_EXEC_WAIT(N(onBurnHit)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_BurnStill) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -302,28 +299,28 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(onHit)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(jumpHome)) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_SET(LVar1, ANIM_BattleBowser_Walk) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(jumpHome)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -342,19 +339,19 @@ EvtScript N(handleEvent) = { EVT_END_SWITCH EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET(LVar1, ANIM_BattleBowser_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_SPIKE_TAUNT) EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Jump) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleBowser_PostJump) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 4, EVT_FLOAT(3.0)) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -457,7 +454,7 @@ EvtScript N(onSpinSmashOrNormalHit) = { }; EvtScript N(onHit) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_RETURN EVT_END @@ -523,7 +520,7 @@ EvtScript N(onDeath) = { }; EvtScript N(onImmune) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_RETURN EVT_END diff --git a/src/battle/area/kpa2/actor/bowser_phase_2.c b/src/battle/area/kpa2/actor/bowser_phase_2.c index 68cb2d0012..4caacb746e 100644 --- a/src/battle/area/kpa2/actor/bowser_phase_2.c +++ b/src/battle/area/kpa2/actor/bowser_phase_2.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BattleBowser.h" -#include "effects.h" -#define NAMESPACE b_area_kpa2_bowser_phase_2 +#define NAMESPACE A(bowser_phase_2) extern EvtScript N(init); extern EvtScript N(idle); @@ -248,20 +245,20 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(onHit)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(jumpHome)) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_SET(LVar1, ANIM_BattleBowser_Walk) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(jumpHome)) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) @@ -282,7 +279,7 @@ EvtScript N(handleEvent) = { EVT_END_SWITCH EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET(LVar1, ANIM_BattleBowser_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_SPIKE_TAUNT) @@ -292,7 +289,7 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Jump) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleBowser_PostJump) @@ -300,7 +297,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_SWAP_PARTNER) EVT_CALL(N(UnfadeBackgroundToBlack)) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -374,23 +371,23 @@ EvtScript N(onHit) = { }; EvtScript N(doOnHit) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_RETURN EVT_END }; EvtScript N(onDeath) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END }; EvtScript N(onImmune) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_RETURN EVT_END diff --git a/src/battle/area/kpa2/actor/bowser_phase_3.c b/src/battle/area/kpa2/actor/bowser_phase_3.c index 48ce6e7a23..45d4ed0785 100644 --- a/src/battle/area/kpa2/actor/bowser_phase_3.c +++ b/src/battle/area/kpa2/actor/bowser_phase_3.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BattleBowser.h" -#include "effects.h" -#define NAMESPACE b_area_kpa2_bowser_phase_3 +#define NAMESPACE A(bowser_phase_3) extern EvtScript N(init); extern EvtScript N(idle); @@ -355,7 +352,7 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) @@ -379,30 +376,30 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(onHit)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(jumpHome)) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_SET(LVar1, ANIM_BattleBowser_Walk) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(jumpHome)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -421,13 +418,13 @@ EvtScript N(handleEvent) = { EVT_END_SWITCH EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET(LVar1, ANIM_BattleBowser_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_SPIKE_TAUNT) EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Jump) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleBowser_PostJump) @@ -435,7 +432,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_SWAP_PARTNER) EVT_CALL(N(UnfadeBackgroundToBlack)) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBowser_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -508,7 +505,7 @@ EvtScript N(onHit) = { }; EvtScript N(doOnHit) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_RETURN EVT_END @@ -649,7 +646,7 @@ EvtScript N(onDeath) = { }; EvtScript N(onImmune) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_RETURN EVT_END diff --git a/src/battle/area/kpa2/area.c b/src/battle/area/kpa2/area.c index 7502220f80..5a83c174c1 100644 --- a/src/battle/area/kpa2/area.c +++ b/src/battle/area/kpa2/area.c @@ -1,52 +1,49 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_kpa2 +extern ActorBlueprint A(bowser); +extern ActorBlueprint A(bowser_intro); +extern ActorBlueprint A(bowser_phase_1); +extern ActorBlueprint A(bowser_phase_2); +extern ActorBlueprint A(bowser_phase_3); -extern ActorBlueprint N(bowser); -extern ActorBlueprint N(bowser_intro); -extern ActorBlueprint N(bowser_phase_1); -extern ActorBlueprint N(bowser_phase_2); -extern ActorBlueprint N(bowser_phase_3); +extern Stage A(kpa_01); +extern Stage A(kkj_01); +extern Stage A(kkj_02); -extern Stage N(kpa_01); -extern Stage N(kpa_02); -extern Stage N(kpa_03); +Vec3i A(bowser_pos) = { 80, 0, -10 }; -Vec3i N(bowser_pos) = { 80, 0, -10 }; - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(bowser), BTL_POS_GROUND_C, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(bowser), BTL_POS_GROUND_C, 10), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(bowser_intro), BTL_POS_GROUND_C, 10), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(bowser_intro), BTL_POS_GROUND_C, 10), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(bowser_phase_1), BTL_POS_GROUND_C, 10), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(bowser_phase_1), BTL_POS_GROUND_C, 10), }; -Formation N(Formation_03) = { - ACTOR_BY_POS(N(bowser_phase_2), N(bowser_pos), 10), +Formation A(Formation_03) = { + ACTOR_BY_POS(A(bowser_phase_2), A(bowser_pos), 10), }; -Formation N(Formation_04) = { - ACTOR_BY_POS(N(bowser_phase_3), N(bowser_pos), 10), +Formation A(Formation_04) = { + ACTOR_BY_POS(A(bowser_phase_3), A(bowser_pos), 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kpa_01), "クッパ"), - BATTLE(N(Formation_01), N(kpa_02), "クッパ(オープニング)"), - BATTLE(N(Formation_02), N(kpa_02), "クッパ(ラストバトル1)"), - BATTLE(N(Formation_03), N(kpa_03), "クッパ(ラストバトル2)"), - BATTLE(N(Formation_04), N(kpa_03), "クッパ(ラストバトル3)"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kpa_01), "クッパ"), + BATTLE(A(Formation_01), A(kkj_01), "クッパ(オープニング)"), + BATTLE(A(Formation_02), A(kkj_01), "クッパ(ラストバトル1)"), + BATTLE(A(Formation_03), A(kkj_02), "クッパ(ラストバトル2)"), + BATTLE(A(Formation_04), A(kkj_02), "クッパ(ラストバトル3)"), {}, }; -StageList N(Stages) = { - STAGE("kpa_01", N(kpa_01)), - STAGE("kpa_02", N(kpa_02)), - STAGE("kpa_03", N(kpa_03)), +StageList A(Stages) = { + STAGE("kpa_01", A(kpa_01)), + STAGE("kpa_02", A(kkj_01)), + STAGE("kpa_03", A(kkj_02)), {}, }; diff --git a/src/battle/area/kpa2/area.h b/src/battle/area/kpa2/area.h new file mode 100644 index 0000000000..151461c145 --- /dev/null +++ b/src/battle/area/kpa2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kpa2 diff --git a/src/battle/area/kpa2/stage/kkj_01.c b/src/battle/area/kpa2/stage/kkj_01.c new file mode 100644 index 0000000000..36b2499118 --- /dev/null +++ b/src/battle/area/kpa2/stage/kkj_01.c @@ -0,0 +1,3 @@ +#include "../area.h" + +#include "battle/common/stage/area_kkj/kkj_01.inc.c" diff --git a/src/battle/area/kpa2/stage/kkj_02.c b/src/battle/area/kpa2/stage/kkj_02.c new file mode 100644 index 0000000000..20e2d08114 --- /dev/null +++ b/src/battle/area/kpa2/stage/kkj_02.c @@ -0,0 +1,3 @@ +#include "../area.h" + +#include "battle/common/stage/area_kkj/kkj_02.inc.c" diff --git a/src/battle/area/kpa2/stage/kpa_01.c b/src/battle/area/kpa2/stage/kpa_01.c index 5d5a70292f..09e1d57642 100644 --- a/src/battle/area/kpa2/stage/kpa_01.c +++ b/src/battle/area/kpa2/stage/kpa_01.c @@ -1,57 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa2_kpa_01 - -// blue torches -EvtScript N(EVS_TexPan_Fire) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 0x8000) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 36, MODEL_GROUP_HIDDEN) - EVT_THREAD - EVT_SET(LVar0, MODEL_o416) - EVT_EXEC(N(EVS_TexPan_Fire)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_o418) - EVT_EXEC(N(EVS_TexPan_Fire)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o382, - MODEL_o381, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt01_shape", - .hit = "kpa_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_01.inc.c" diff --git a/src/battle/area/kpa2/stage/kpa_03.c b/src/battle/area/kpa2/stage/kpa_03.c deleted file mode 100644 index d79ffe4ce8..0000000000 --- a/src/battle/area/kpa2/stage/kpa_03.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "common.h" -#include "battle/battle.h" - -#define NAMESPACE b_area_kpa2_kpa_03 - -#include "battle/common/stage/kkj_02.inc.c" diff --git a/src/battle/area/kpa3/actor/anti_guy.c b/src/battle/area/kpa3/actor/anti_guy.c index 7e6edbe59f..8edc0bdf2f 100644 --- a/src/battle/area/kpa3/actor/anti_guy.c +++ b/src/battle/area/kpa3/actor/anti_guy.c @@ -1,497 +1,4 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ShyGuy.h" +#include "../area.h" -#define NAMESPACE b_area_kpa3_anti_guy - -extern s32 N(IdleAnimations)[]; -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 50, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 50, - STATUS_KEY_SHRINK, 50, - STATUS_KEY_STOP, 50, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, -1, - STATUS_TURN_MOD_STOP, -2, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_ANTI_GUY_DUP, - .level = 42, - .maxHP = 50, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 0, - .airLiftChance = 0, - .hurricaneChance = 0, - .spookChance = 0, - .upAndAwayChance = 0, - .spinSmashReq = 0, - .powerBounceChance = 75, - .coinReward = 0, - .size = { 30, 30 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_ShyGuy_Black_Anim01, - STATUS_KEY_STONE, ANIM_ShyGuy_Black_Anim00, - STATUS_KEY_SLEEP, ANIM_ShyGuy_Black_Anim12, - STATUS_KEY_POISON, ANIM_ShyGuy_Black_Anim01, - STATUS_KEY_STOP, ANIM_ShyGuy_Black_Anim00, - STATUS_KEY_STATIC, ANIM_ShyGuy_Black_Anim01, - STATUS_KEY_PARALYZE, ANIM_ShyGuy_Black_Anim00, - STATUS_KEY_DIZZY, ANIM_ShyGuy_Black_Anim13, - STATUS_KEY_FEAR, ANIM_ShyGuy_Black_Anim13, - STATUS_END, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(returnHome) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Black_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Black_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim03) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Black_Anim14) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(bumpAttack) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_END_THREAD - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim05) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 10, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_WAIT(8) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(acrobaticAttack) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 80) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) - EVT_THREAD - EVT_WAIT(12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) - EVT_THREAD - EVT_WAIT(9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 12, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(20) - EVT_SUB(LVar3, 30) - EVT_IF_LT(LVar3, 0) - EVT_ADD(LVar3, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim07) - EVT_WAIT(15) - EVT_GOTO(2) - EVT_LABEL(1) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim10) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 50) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim11) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim13) - EVT_END_IF - EVT_WAIT(25) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_LABEL(2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(RandInt, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_EXEC_WAIT(N(bumpAttack)) - EVT_ELSE - EVT_EXEC_WAIT(N(acrobaticAttack)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#define ANTIGUY_TRIO // use a slightly modified Anti-Guy actor +#include "battle/common/actor/anti_guy.inc.c" diff --git a/src/battle/area/kpa3/actor/duplighost.c b/src/battle/area/kpa3/actor/duplighost.c index 66027108a5..73800cf8dc 100644 --- a/src/battle/area/kpa3/actor/duplighost.c +++ b/src/battle/area/kpa3/actor/duplighost.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kpa3_duplighost +#include "../area.h" #include "battle/common/actor/duplighost.inc.c" diff --git a/src/battle/area/kpa3/area.c b/src/battle/area/kpa3/area.c index d7ceff270e..a8a3611845 100644 --- a/src/battle/area/kpa3/area.c +++ b/src/battle/area/kpa3/area.c @@ -1,39 +1,36 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_kpa3 +extern ActorBlueprint A(duplighost); +extern ActorBlueprint A(anti_guy); -extern ActorBlueprint N(duplighost); -extern ActorBlueprint N(anti_guy); +extern Stage A(kpa_01); -extern Stage N(kpa_01); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(anti_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(anti_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(anti_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(anti_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(anti_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(anti_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_D, 7), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_D, 7), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kpa_01), "ブラックヘイホーx3"), - BATTLE(N(Formation_01), N(kpa_01), "バケバケx2"), - BATTLE(N(Formation_02), N(kpa_01), "バケバケx4"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kpa_01), "ブラックヘイホーx3"), + BATTLE(A(Formation_01), A(kpa_01), "バケバケx2"), + BATTLE(A(Formation_02), A(kpa_01), "バケバケx4"), {}, }; -StageList N(Stages) = { - STAGE("kpa_01", N(kpa_01)), +StageList A(Stages) = { + STAGE("kpa_01", A(kpa_01)), {}, }; diff --git a/src/battle/area/kpa3/area.h b/src/battle/area/kpa3/area.h new file mode 100644 index 0000000000..c6b65d0298 --- /dev/null +++ b/src/battle/area/kpa3/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kpa3 diff --git a/src/battle/area/kpa3/stage/kpa_01.c b/src/battle/area/kpa3/stage/kpa_01.c index 9b61c888cd..09e1d57642 100644 --- a/src/battle/area/kpa3/stage/kpa_01.c +++ b/src/battle/area/kpa3/stage/kpa_01.c @@ -1,56 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa3_kpa_01 - -EvtScript N(8022EFE0) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 36, MODEL_GROUP_HIDDEN) - EVT_THREAD - EVT_SET(LVar0, 37) - EVT_EXEC(N(8022EFE0)) - EVT_WAIT(5) - EVT_SET(LVar0, 39) - EVT_EXEC(N(8022EFE0)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o382, - MODEL_o381, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt01_shape", - .hit = "kpa_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_01.inc.c" diff --git a/src/battle/area/kpa4/actor/bombshell_bill.c b/src/battle/area/kpa4/actor/bombshell_bill.c index 8cfe5e0dbc..c8ebf8d5c0 100644 --- a/src/battle/area/kpa4/actor/bombshell_bill.c +++ b/src/battle/area/kpa4/actor/bombshell_bill.c @@ -143,7 +143,7 @@ EvtScript N(idle) = { EvtScript N(explode) = { EVT_EXEC_WAIT(N(playExplosionEffects)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_BurnHurt) EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) EVT_EXEC_WAIT(EVS_Enemy_Death) @@ -157,11 +157,11 @@ EvtScript N(handleEvent) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_BURN_HIT) @@ -177,13 +177,13 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(explode)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_EXEC_WAIT(N(explode)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_EXEC_WAIT(N(explode)) @@ -191,12 +191,12 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(explode)) @@ -205,21 +205,21 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(explode)) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(explode)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Tense) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_Tense) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -283,7 +283,7 @@ EvtScript N(takeTurn) = { EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 6, BS_FLAGS1_SP_EVT_ACTIVE) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BulletBill_Gold_BurnHurt) EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) EVT_EXEC_WAIT(EVS_Enemy_Death) diff --git a/src/battle/area/kpa4/actor/bombshell_bill_blaster.c b/src/battle/area/kpa4/actor/bombshell_bill_blaster.c index 0afce2b84d..794a86aa5e 100644 --- a/src/battle/area/kpa4/actor/bombshell_bill_blaster.c +++ b/src/battle/area/kpa4/actor/bombshell_bill_blaster.c @@ -118,50 +118,50 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Hurt) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Hurt) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BillBlaster_Gold_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -214,7 +214,7 @@ EvtScript N(bulletShot) = { EVT_PLAY_EFFECT(EFFECT_00, LVar0, LVar1, LVar2, 2, 5, 2, 2, 0) EVT_WAIT(2) EVT_CALL(ApplyBillSettings) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bill)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bill)), FALSE) EVT_CALL(SetActorVar, ACTOR_SELF, 0, LVar0) EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) EVT_RETURN diff --git a/src/battle/area/kpa4/actor/koopatrol.c b/src/battle/area/kpa4/actor/koopatrol.c index ab7feeace9..25c356920f 100644 --- a/src/battle/area/kpa4/actor/koopatrol.c +++ b/src/battle/area/kpa4/actor/koopatrol.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kpa4_koopatrol +#include "../area.h" #include "battle/common/actor/koopatrol.inc.c" diff --git a/src/battle/area/kpa4/actor/magikoopa.c b/src/battle/area/kpa4/actor/magikoopa.c index 3760818e05..20f3a00bd6 100644 --- a/src/battle/area/kpa4/actor/magikoopa.c +++ b/src/battle/area/kpa4/actor/magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kpa4_magikoopa +#include "../area.h" #include "battle/common/actor/magikoopa.inc.c" diff --git a/src/battle/area/kpa4/area.c b/src/battle/area/kpa4/area.c index e0b47f23a7..cae641bcf0 100644 --- a/src/battle/area/kpa4/area.c +++ b/src/battle/area/kpa4/area.c @@ -1,85 +1,82 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_kpa4 +extern ActorBlueprint A(bombshell_bill_blaster); +extern ActorBlueprint A(bombshell_bill); +extern ActorBlueprint A(magikoopa); +extern ActorBlueprint A(koopatrol); -extern ActorBlueprint N(bombshell_bill_blaster); -extern ActorBlueprint N(bombshell_bill); -extern ActorBlueprint N(magikoopa); -extern ActorBlueprint N(koopatrol); +extern Stage A(kpa_01); +extern Stage A(kpa_01b); +extern Stage A(kpa_02); +extern Stage A(kpa_03); +extern Stage A(kpa_04); +extern Stage A(kpa_04b); +extern Stage A(kpa_04c); +extern Stage A(kpa_05); +extern Stage A(kpa_07); +extern Stage A(kpa_08); +extern Stage A(kpa_09); +extern Stage A(kpa_11); +extern Stage A(kpa_13); +extern Stage A(kpa_14); -extern Stage N(kpa_01); -extern Stage N(kpa_01b); -extern Stage N(kpa_02); -extern Stage N(kpa_03); -extern Stage N(kpa_04); -extern Stage N(kpa_04b); -extern Stage N(kpa_04c); -extern Stage N(kpa_05); -extern Stage N(kpa_07); -extern Stage N(kpa_08); -extern Stage N(kpa_09); -extern Stage N(kpa_11); -extern Stage N(kpa_13); -extern Stage N(kpa_14); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(bombshell_bill), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(bombshell_bill), BTL_POS_GROUND_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(bombshell_bill), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(bombshell_bill), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(bombshell_bill), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bombshell_bill), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bombshell_bill), BTL_POS_GROUND_C, 8), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(bombshell_bill), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bombshell_bill), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bombshell_bill), BTL_POS_GROUND_C, 8), }; -Vec3i N(blaster_pos_1) = { 70, 0, -20 }; +Vec3i A(blaster_pos_1) = { 70, 0, -20 }; -Vec3i N(blaster_pos_2) = { 100, 0, 0 }; +Vec3i A(blaster_pos_2) = { 100, 0, 0 }; -Formation N(Formation_02) = { - ACTOR_BY_POS(N(bombshell_bill_blaster), N(blaster_pos_1), 10), - ACTOR_BY_POS(N(bombshell_bill_blaster), N(blaster_pos_2), 9), +Formation A(Formation_02) = { + ACTOR_BY_POS(A(bombshell_bill_blaster), A(blaster_pos_1), 10), + ACTOR_BY_POS(A(bombshell_bill_blaster), A(blaster_pos_2), 9), }; -Vec3i N(pos_3) = { 130, 0, 25 }; +Vec3i A(pos_3) = { 130, 0, 25 }; -Formation N(Formation_03) = { - ACTOR_BY_POS(N(bombshell_bill_blaster), N(blaster_pos_1), 10), - ACTOR_BY_POS(N(bombshell_bill_blaster), N(blaster_pos_2), 9), - ACTOR_BY_POS(N(koopatrol), N(pos_3), 8), +Formation A(Formation_03) = { + ACTOR_BY_POS(A(bombshell_bill_blaster), A(blaster_pos_1), 10), + ACTOR_BY_POS(A(bombshell_bill_blaster), A(blaster_pos_2), 9), + ACTOR_BY_POS(A(koopatrol), A(pos_3), 8), }; -Formation N(Formation_04) = { - ACTOR_BY_POS(N(bombshell_bill_blaster), N(blaster_pos_1), 10), - ACTOR_BY_POS(N(bombshell_bill_blaster), N(blaster_pos_2), 9), - ACTOR_BY_POS(N(magikoopa), N(pos_3), 8), +Formation A(Formation_04) = { + ACTOR_BY_POS(A(bombshell_bill_blaster), A(blaster_pos_1), 10), + ACTOR_BY_POS(A(bombshell_bill_blaster), A(blaster_pos_2), 9), + ACTOR_BY_POS(A(magikoopa), A(pos_3), 8), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kpa_01), "スーパーキラーx2"), - BATTLE(N(Formation_01), N(kpa_01), "スーパーキラーx3"), - BATTLE(N(Formation_02), N(kpa_01), "スーパーキラーたいほうx2"), - BATTLE(N(Formation_03), N(kpa_01), "スーパーキラーたいほうx2,トゲノコ"), - BATTLE(N(Formation_04), N(kpa_01), "スーパーキラーたいほうx2,カメック"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kpa_01), "スーパーキラーx2"), + BATTLE(A(Formation_01), A(kpa_01), "スーパーキラーx3"), + BATTLE(A(Formation_02), A(kpa_01), "スーパーキラーたいほうx2"), + BATTLE(A(Formation_03), A(kpa_01), "スーパーキラーたいほうx2,トゲノコ"), + BATTLE(A(Formation_04), A(kpa_01), "スーパーキラーたいほうx2,カメック"), {}, }; -StageList N(Stages) = { - STAGE("kpa_01", N(kpa_01)), - STAGE("kpa_01b", N(kpa_01b)), - STAGE("kpa_02", N(kpa_02)), - STAGE("kpa_03", N(kpa_04)), // @bug should be &N(kpa_03) - STAGE("kpa_04", N(kpa_04)), - STAGE("kpa_04b", N(kpa_04b)), - STAGE("kpa_04c", N(kpa_04c)), - STAGE("kpa_05", N(kpa_05)), - STAGE("kpa_07", N(kpa_07)), - STAGE("kpa_08", N(kpa_08)), - STAGE("kpa_09", N(kpa_09)), - STAGE("kpa_11", N(kpa_11)), - STAGE("kpa_13", N(kpa_13)), - STAGE("kpa_14", N(kpa_14)), +StageList A(Stages) = { + STAGE("kpa_01", A(kpa_01)), + STAGE("kpa_01b", A(kpa_01b)), + STAGE("kpa_02", A(kpa_02)), + STAGE("kpa_03", A(kpa_04)), // @bug should be &A(kpa_03) + STAGE("kpa_04", A(kpa_04)), + STAGE("kpa_04b", A(kpa_04b)), + STAGE("kpa_04c", A(kpa_04c)), + STAGE("kpa_05", A(kpa_05)), + STAGE("kpa_07", A(kpa_07)), + STAGE("kpa_08", A(kpa_08)), + STAGE("kpa_09", A(kpa_09)), + STAGE("kpa_11", A(kpa_11)), + STAGE("kpa_13", A(kpa_13)), + STAGE("kpa_14", A(kpa_14)), {}, }; diff --git a/src/battle/area/kpa4/area.h b/src/battle/area/kpa4/area.h new file mode 100644 index 0000000000..710946bbcc --- /dev/null +++ b/src/battle/area/kpa4/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kpa4 diff --git a/src/battle/area/kpa4/stage/kpa_01.c b/src/battle/area/kpa4/stage/kpa_01.c index e5b7d161f9..09e1d57642 100644 --- a/src/battle/area/kpa4/stage/kpa_01.c +++ b/src/battle/area/kpa4/stage/kpa_01.c @@ -1,56 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_01 - -EvtScript N(8022EFE0) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 36, MODEL_GROUP_HIDDEN) - EVT_THREAD - EVT_SET(LVar0, 37) - EVT_EXEC(N(8022EFE0)) - EVT_WAIT(5) - EVT_SET(LVar0, 39) - EVT_EXEC(N(8022EFE0)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o382, - MODEL_o381, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt01_shape", - .hit = "kpa_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_01.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_01b.c b/src/battle/area/kpa4/stage/kpa_01b.c index d4d9f58860..b6217f6908 100644 --- a/src/battle/area/kpa4/stage/kpa_01b.c +++ b/src/battle/area/kpa4/stage/kpa_01b.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_01b - -EvtScript N(8022F180) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 25, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 37) - EVT_EXEC(N(8022F180)) - EVT_SET(LVar0, 39) - EVT_EXEC(N(8022F180)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o382, - MODEL_o381, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt01_shape", - .hit = "kpa_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_01b.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_02.c b/src/battle/area/kpa4/stage/kpa_02.c index ead6884e14..be987f0fbc 100644 --- a/src/battle/area/kpa4/stage/kpa_02.c +++ b/src/battle/area/kpa4/stage/kpa_02.c @@ -1,104 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_02 - -EvtScript N(8022F300) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022F3D0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022F4BC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 16) - EVT_SET(LVar1, 1) - EVT_SET(LVar2, -400) - EVT_SET(LVar3, -800) - EVT_EXEC(N(8022F3D0)) - EVT_SET(LVar0, 19) - EVT_SET(LVar1, 3) - EVT_SET(LVar2, -400) - EVT_SET(LVar3, -800) - EVT_EXEC(N(8022F3D0)) - EVT_SET(LVar0, 17) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, -400) - EVT_SET(LVar3, -800) - EVT_EXEC(N(8022F4BC)) - EVT_SET(LVar0, 18) - EVT_SET(LVar1, 2) - EVT_SET(LVar2, -400) - EVT_SET(LVar3, -800) - EVT_EXEC(N(8022F4BC)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_saku, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt02_shape", - .hit = "kpa_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_02.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_03.c b/src/battle/area/kpa4/stage/kpa_03.c index 1dac690373..3ea4b2a6ee 100644 --- a/src/battle/area/kpa4/stage/kpa_03.c +++ b/src/battle/area/kpa4/stage/kpa_03.c @@ -1,33 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/kpa_bt03_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_03 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetDarknessMode, BTL_DARKNESS_MODE_1) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_tar1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt03_shape", - .hit = "kpa_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_03.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_04.c b/src/battle/area/kpa4/stage/kpa_04.c index e1254738a2..aea703f078 100644 --- a/src/battle/area/kpa4/stage/kpa_04.c +++ b/src/battle/area/kpa4/stage/kpa_04.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_04 - -EvtScript N(8022F7F0) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 15, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 17, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 16, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 26, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 18, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 20, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 22, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 24, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 32) - EVT_EXEC(N(8022F7F0)) - EVT_SET(LVar0, 34) - EVT_EXEC(N(8022F7F0)) - EVT_SET(LVar0, 36) - EVT_EXEC(N(8022F7F0)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt04_shape", - .hit = "kpa_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_04.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_04b.c b/src/battle/area/kpa4/stage/kpa_04b.c index c475cc3ccd..fec75f8773 100644 --- a/src/battle/area/kpa4/stage/kpa_04b.c +++ b/src/battle/area/kpa4/stage/kpa_04b.c @@ -1,52 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_04b - -EvtScript N(8022FA10) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 13, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 17, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 16, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 18, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 20, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 22, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 24, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 32) - EVT_EXEC(N(8022FA10)) - EVT_SET(LVar0, 34) - EVT_EXEC(N(8022FA10)) - EVT_SET(LVar0, 36) - EVT_EXEC(N(8022FA10)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt04_shape", - .hit = "kpa_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_04b.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_04c.c b/src/battle/area/kpa4/stage/kpa_04c.c index 77b526dfd4..9a5d9887df 100644 --- a/src/battle/area/kpa4/stage/kpa_04c.c +++ b/src/battle/area/kpa4/stage/kpa_04c.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_04c - -EvtScript N(8022FC20) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 30, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 39, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 38, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 36, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 34, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 32, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 18) - EVT_EXEC(N(8022FC20)) - EVT_SET(LVar0, 20) - EVT_EXEC(N(8022FC20)) - EVT_SET(LVar0, 22) - EVT_EXEC(N(8022FC20)) - EVT_SET(LVar0, 24) - EVT_EXEC(N(8022FC20)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt04_shape", - .hit = "kpa_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_04c.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_05.c b/src/battle/area/kpa4/stage/kpa_05.c index 5944139811..8719a430e3 100644 --- a/src/battle/area/kpa4/stage/kpa_05.c +++ b/src/battle/area/kpa4/stage/kpa_05.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt05_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_05 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_saku, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt05_shape", - .hit = "kpa_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_05.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_07.c b/src/battle/area/kpa4/stage/kpa_07.c index ce94eb0b28..d3db812594 100644 --- a/src/battle/area/kpa4/stage/kpa_07.c +++ b/src/battle/area/kpa4/stage/kpa_07.c @@ -1,99 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt07_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_07 - -EvtScript N(8022FEB0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022FF80) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8023006C) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 16) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, -200) - EVT_SET(LVar3, 0) - EVT_EXEC(N(8022FEB0)) - EVT_SET(LVar0, 17) - EVT_SET(LVar1, 1) - EVT_SET(LVar2, -120) - EVT_SET(LVar3, 0) - EVT_EXEC(N(8022FEB0)) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 2) - EVT_SET(LVar2, -100) - EVT_SET(LVar3, 0) - EVT_EXEC(N(8022FEB0)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_kemu1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt07_shape", - .hit = "kpa_bt07_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_07.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_08.c b/src/battle/area/kpa4/stage/kpa_08.c index b055bfed47..8b5a6e1d80 100644 --- a/src/battle/area/kpa4/stage/kpa_08.c +++ b/src/battle/area/kpa4/stage/kpa_08.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt08_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_08 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o478, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt08_shape", - .hit = "kpa_bt08_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_08.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_09.c b/src/battle/area/kpa4/stage/kpa_09.c index 763d6af284..3a4f4f3bd8 100644 --- a/src/battle/area/kpa4/stage/kpa_09.c +++ b/src/battle/area/kpa4/stage/kpa_09.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt09_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_09 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o353, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt09_shape", - .hit = "kpa_bt09_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_09.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_11.c b/src/battle/area/kpa4/stage/kpa_11.c index 7685f36380..263100c5f3 100644 --- a/src/battle/area/kpa4/stage/kpa_11.c +++ b/src/battle/area/kpa4/stage/kpa_11.c @@ -1,31 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/kpa_bt11_shape.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_11 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_h2, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt11_shape", - .hit = "kpa_bt11_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kpa/kpa_11.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_13.c b/src/battle/area/kpa4/stage/kpa_13.c index b78ea3dd2f..c87a275dcd 100644 --- a/src/battle/area/kpa4/stage/kpa_13.c +++ b/src/battle/area/kpa4/stage/kpa_13.c @@ -1,39 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_13 - -EvtScript N(80230440) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt13_shape", - .hit = "kpa_bt13_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_13.inc.c" diff --git a/src/battle/area/kpa4/stage/kpa_14.c b/src/battle/area/kpa4/stage/kpa_14.c index 7f733c04f6..df348b13ec 100644 --- a/src/battle/area/kpa4/stage/kpa_14.c +++ b/src/battle/area/kpa4/stage/kpa_14.c @@ -1,39 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kpa4_kpa_14 - -EvtScript N(80230570) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, 32768) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kpa_tex", - .shape = "kpa_bt14_shape", - .hit = "kpa_bt14_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kpa/kpa_14.inc.c" diff --git a/src/battle/area/kzn/actor/lava_bubble.c b/src/battle/area/kzn/actor/lava_bubble.c index d80561b8fb..5512b3717a 100644 --- a/src/battle/area/kzn/actor/lava_bubble.c +++ b/src/battle/area/kzn/actor/lava_bubble.c @@ -1,686 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/LavaBubble.h" +#include "../area.h" -#define NAMESPACE b_area_kzn_lava_bubble - -extern s32 N(IdleAnimations_80218FC4)[]; -extern s32 N(IdleAnimations_80219010)[]; -extern EvtScript N(init_8021901C); -extern EvtScript N(takeTurn_8021AEA4); -extern EvtScript N(idle_802191E4); -extern EvtScript N(handleEvent_80219500); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, - PRT_5 = 5, -}; - -s32 N(DefenseTable_80218E10)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_WATER, -2, - ELEMENT_ICE, -2, - ELEMENT_FIRE, 99, - ELEMENT_BLAST, -1, - ELEMENT_END, -}; - -s32 N(StatusTable_80218E3C)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 50, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 100, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 50, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 85, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -2, 25 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80218FC4), - .defenseTable = N(DefenseTable_80218E10), - .eventFlags = ACTOR_EVENT_FLAG_FIREY, - .elementImmunityFlags = ELEMENT_FIRE, - .projectileTargetOffset = { -3, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80219010), - .defenseTable = N(DefenseTable_80218E10), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80219010), - .defenseTable = N(DefenseTable_80218E10), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_4, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80219010), - .defenseTable = N(DefenseTable_80218E10), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_5, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80219010), - .defenseTable = N(DefenseTable_80218E10), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_FLYING, - .type = ACTOR_TYPE_LAVA_BUBBLE, - .level = 17, - .maxHP = 9, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021901C), - .statusTable = N(StatusTable_80218E3C), - .escapeChance = 50, - .airLiftChance = 90, - .hurricaneChance = 85, - .spookChance = 50, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 80, - .coinReward = 1, - .size = { 33, 32 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_80218FC4)[] = { - STATUS_KEY_NORMAL, ANIM_LavaBubble_Anim01, - STATUS_KEY_STONE, ANIM_LavaBubble_Anim00, - STATUS_KEY_SLEEP, ANIM_LavaBubble_Anim01, - STATUS_KEY_POISON, ANIM_LavaBubble_Anim01, - STATUS_KEY_STOP, ANIM_LavaBubble_Anim00, - STATUS_KEY_STATIC, ANIM_LavaBubble_Anim01, - STATUS_KEY_PARALYZE, ANIM_LavaBubble_Anim00, - STATUS_KEY_DIZZY, ANIM_LavaBubble_Anim0A, - STATUS_KEY_FEAR, ANIM_LavaBubble_Anim0A, - STATUS_END, -}; - -s32 N(IdleAnimations_80219010)[] = { - STATUS_KEY_NORMAL, ANIM_LavaBubble_Anim01, - STATUS_END, -}; - -EvtScript N(init_8021901C) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021AEA4))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_802191E4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80219500))) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_END_SWITCH - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_5, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 5) - EVT_CALL(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_802191E4) = { - EVT_LABEL(0) - EVT_CALL(MakeLerp, 0, 10, 25, EASING_COS_IN_OUT) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(GetHomePos, ACTOR_SELF, LVar2, LVar3, LVar4) - EVT_ADD(LVar0, LVar3) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar2, LVar0, LVar4) - EVT_IF_EQ(LVar1, 1) - EVT_LABEL(11) - EVT_WAIT(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_GOTO(11) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_GOTO(11) - EVT_END_IF - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(MakeLerp, 10, 0, 25, EASING_COS_IN_OUT) - EVT_LABEL(2) - EVT_CALL(UpdateLerp) - EVT_CALL(GetHomePos, ACTOR_SELF, LVar2, LVar3, LVar4) - EVT_ADD(LVar0, LVar3) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar2, LVar0, LVar4) - EVT_IF_EQ(LVar1, 1) - EVT_LABEL(22) - EVT_WAIT(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_GOTO(22) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_GOTO(22) - EVT_END_IF - EVT_GOTO(2) - EVT_END_IF - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -#include "common/UnkSfxFunc.inc.c" - -EvtScript N(80219464) = { - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_THREAD - EVT_CALL(N(UnkSfxFunc)) - EVT_END_THREAD - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80219500) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim08) - EVT_SET_CONST(LVar2, ANIM_LavaBubble_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim08) - EVT_SET_CONST(LVar2, ANIM_LavaBubble_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(80219464)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CASE_OR_EQ(EVENT_BURN_TAUNT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) - EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) - EVT_CALL(HPBarToCurrent, ACTOR_SELF) - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_EXEC_WAIT(N(80219464)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim03) - EVT_SET_CONST(LVar2, ANIM_LavaBubble_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_UP_AND_AWAY) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(fireTackle) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 5) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_THREAD - EVT_CALL(N(UnkSfxFunc)) - EVT_END_THREAD - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim01) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_ADD(LVar2, 1) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 10) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 3, FALSE, TRUE, FALSE) - EVT_WAIT(14) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(80219464)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar2, 1) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_SET(LVar0, 1) - EVT_SET(LVar1, 4587524) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_WAIT(5) - EVT_EXEC_WAIT(N(80219464)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021A074) = { - EVT_SET(LVar6, 2) - EVT_LOOP(4) - EVT_THREAD - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, LVar6, EVT_FLOAT(0.2), EVT_FLOAT(0.2), EVT_FLOAT(0.2)) - EVT_ELSE - EVT_CALL(SetPartScale, ACTOR_SELF, LVar6, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_END_IF - EVT_CALL(SetPartPos, ACTOR_SELF, LVar6, LVar0, LVar1, LVar2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar6, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, LVar6, EVT_FLOAT(8.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, LVar6, EVT_FLOAT(0.01)) - EVT_CALL(SetPartSounds, ACTOR_SELF, LVar6, ACTOR_SOUND_JUMP, 720, 0) - EVT_CALL(JumpPartTo, ACTOR_SELF, LVar6, LVar3, LVar4, LVar5, 0, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_END_THREAD - EVT_WAIT(3) - EVT_ADD(LVar6, 1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8021A218) = { - EVT_EXEC(N(8021A074)) - EVT_CALL(GetDistanceToGoal, ACTOR_SELF, LVar0) - EVT_DIVF(LVar0, EVT_FLOAT(8.0)) - EVT_ADD(LVar0, 1) - EVT_WAIT(LVar0) - EVT_RETURN - EVT_END -}; - -EvtScript N(fireballs_Partner) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PARTNER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_EQ(LVarA, 1) - EVT_ADD(LVar0, 100) - EVT_SET(LVar1, 5) - EVT_ELSE - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 50) - EVT_END_IF - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_THREAD - EVT_CALL(N(UnkSfxFunc)) - EVT_END_THREAD - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim01) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim05) - EVT_WAIT(30) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim06) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_ADD(LVar1, 4) - EVT_ADD(LVar2, 2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_SUB(LVar3, 100) - EVT_ADD(LVar5, 2) - EVT_EXEC_WAIT(N(8021A218)) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(20) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(80219464)) - EVT_WAIT(20) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim06) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_ADD(LVar1, 4) - EVT_ADD(LVar2, 2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_SUB(LVar4, 6) - EVT_ADD(LVar5, 2) - EVT_EXEC_WAIT(N(8021A218)) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_NO_CONTACT, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_WAIT(20) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_EXEC_WAIT(N(80219464)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(fireballs_Player) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_THREAD - EVT_CALL(N(UnkSfxFunc)) - EVT_END_THREAD - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_SIN_OUT) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_WAIT(10) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2CF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_ADD(LVar2, 2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(30) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(80219464)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_WAIT(5) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2CF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_SET(LVarA, LVar0) - EVT_SET(LVarB, LVar1) - EVT_SET(LVarC, LVar2) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar2, 2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVarA, LVarB, LVarC) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) - EVT_WAIT(20) - EVT_EXEC_WAIT(N(80219464)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021AEA4) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(fireTackle)) - EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(fireballs_Player)) - EVT_END_SWITCH - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(1) - EVT_CALL(GetStatusFlags, ACTOR_PARTNER, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_KO) - EVT_EXEC_WAIT(N(fireTackle)) - EVT_ELSE - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LE(LVar0, 300) - EVT_EXEC_WAIT(N(fireballs_Partner)) - EVT_ELSE - EVT_EXEC_WAIT(N(fireTackle)) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(0) - EVT_CALL(GetStatusFlags, ACTOR_PARTNER, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_KO) - EVT_EXEC_WAIT(N(fireballs_Player)) - EVT_ELSE - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LE(LVar0, 300) - EVT_EXEC_WAIT(N(fireballs_Partner)) - EVT_ELSE - EVT_EXEC_WAIT(N(fireballs_Player)) - EVT_END_IF - EVT_END_IF - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/lava_bubble.inc.c" diff --git a/src/battle/area/kzn/actor/medi_guy.c b/src/battle/area/kzn/actor/medi_guy.c index 07e673f902..467cbb55b5 100644 --- a/src/battle/area/kzn/actor/medi_guy.c +++ b/src/battle/area/kzn/actor/medi_guy.c @@ -1,9 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/MediGuy.h" - -#define NAMESPACE b_area_kzn_medi_guy +#include "../area.h" #include "battle/common/actor/medi_guy.inc.c" diff --git a/src/battle/area/kzn/actor/putrid_piranha.c b/src/battle/area/kzn/actor/putrid_piranha.c index 846b5acb20..8406585863 100644 --- a/src/battle/area/kzn/actor/putrid_piranha.c +++ b/src/battle/area/kzn/actor/putrid_piranha.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kzn_putrid_piranha +#include "../area.h" #include "battle/common/actor/putrid_piranha.inc.c" diff --git a/src/battle/area/kzn/actor/red_magikoopa.c b/src/battle/area/kzn/actor/red_magikoopa.c index 5710a64efc..b61876c1b6 100644 --- a/src/battle/area/kzn/actor/red_magikoopa.c +++ b/src/battle/area/kzn/actor/red_magikoopa.c @@ -1,3 +1,3 @@ -#define NAMESPACE b_area_kzn_red_magikoopa +#include "../area.h" #include "battle/common/actor/red_magikoopa.inc.c" diff --git a/src/battle/area/kzn/actor/spike_top.c b/src/battle/area/kzn/actor/spike_top.c index a7d36e524e..50761ae894 100644 --- a/src/battle/area/kzn/actor/spike_top.c +++ b/src/battle/area/kzn/actor/spike_top.c @@ -1,6 +1,4 @@ -#include "common.h" - -#define NAMESPACE b_area_kzn_spike_top +#include "../area.h" #include "battle/common/actor/spike_top.inc.c" diff --git a/src/battle/area/kzn/actor/white_magikoopa.c b/src/battle/area/kzn/actor/white_magikoopa.c index 6d240ccaf6..8e56b247f1 100644 --- a/src/battle/area/kzn/actor/white_magikoopa.c +++ b/src/battle/area/kzn/actor/white_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_kzn_white_magikoopa +#include "../area.h" #include "battle/common/actor/white_magikoopa.inc.c" diff --git a/src/battle/area/kzn/area.c b/src/battle/area/kzn/area.c index 395589bc89..aacfc52c78 100644 --- a/src/battle/area/kzn/area.c +++ b/src/battle/area/kzn/area.c @@ -1,181 +1,178 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_kzn +extern ActorBlueprint A(medi_guy); +extern ActorBlueprint A(spike_top); +extern ActorBlueprint A(lava_bubble); +extern ActorBlueprint A(putrid_piranha); +extern ActorBlueprint A(red_magikoopa_flying); +extern ActorBlueprint A(white_magikoopa_flying); -extern ActorBlueprint N(medi_guy); -extern ActorBlueprint N(spike_top); -extern ActorBlueprint N(lava_bubble); -extern ActorBlueprint N(putrid_piranha); -extern ActorBlueprint N(red_magikoopa_flying); -extern ActorBlueprint N(white_magikoopa_flying); +extern Stage A(kzn_01); +extern Stage A(kzn_01b); +extern Stage A(kzn_02); +extern Stage A(kzn_04); +extern Stage A(kzn_04b); +extern Stage A(kzn_04c); +extern Stage A(kzn_05); -extern Stage N(kzn_01); -extern Stage N(kzn_01b); -extern Stage N(kzn_02); -extern Stage N(kzn_04); -extern Stage N(kzn_04b); -extern Stage N(kzn_04c); -extern Stage N(kzn_05); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_C, 8), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_D, 7), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_D, 7), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(red_magikoopa_flying), BTL_POS_AIR_C, 8), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(red_magikoopa_flying), BTL_POS_AIR_C, 8), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(white_magikoopa_flying), BTL_POS_AIR_C, 8), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(white_magikoopa_flying), BTL_POS_AIR_C, 8), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_C, 8), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_C, 9), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_C, 9), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_C, 8), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 9), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 8), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_D, 7), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_D, 7), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 9), +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 8), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_11) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(lava_bubble), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 8), +Formation A(Formation_11) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(lava_bubble), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_12) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_C, 8), +Formation A(Formation_12) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_13) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 8), +Formation A(Formation_13) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_14) = { - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(putrid_piranha), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_D, 7), +Formation A(Formation_14) = { + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(putrid_piranha), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_D, 7), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kzn_01), "バブルx2"), - BATTLE(N(Formation_01), N(kzn_01), "バブルx3"), - BATTLE(N(Formation_02), N(kzn_01), "バブルx4"), - BATTLE(N(Formation_03), N(kzn_01), "バブル,トゲメットx3"), - BATTLE(N(Formation_04), N(kzn_01), "バブルx2,かいふくヘイホー"), - BATTLE(N(Formation_05), N(kzn_01), "バブルx2,レッドカメック"), - BATTLE(N(Formation_06), N(kzn_01), "バブルx2,ホワイトカメック"), - BATTLE(N(Formation_07), N(kzn_01), "バブルx2,トゲメット"), - BATTLE(N(Formation_08), N(kzn_01), "トゲメットx2"), - BATTLE(N(Formation_09), N(kzn_01), "トゲメット,バブル"), - BATTLE(N(Formation_0A), N(kzn_01), "トゲメットx2,バブル"), - BATTLE(N(Formation_0B), N(kzn_01), "トゲメット,ポイズンパックン"), - BATTLE(N(Formation_0C), N(kzn_01), "トゲメットx2,ポイズンパックン"), - BATTLE(N(Formation_0D), N(kzn_01), "トゲメットx2,ポイズンパックンx2"), - BATTLE(N(Formation_0E), N(kzn_01), "トゲメット,バブルx3"), - BATTLE(N(Formation_0F), N(kzn_01), "ポイズンパックンx2"), - BATTLE(N(Formation_10), N(kzn_01), "ポイズンパックンx3"), - BATTLE(N(Formation_11), N(kzn_01), "ポイズンパックン,バブル,ポイズンパックン"), - BATTLE(N(Formation_12), N(kzn_01), "ポイズンパックンx2,トゲメット"), - BATTLE(N(Formation_13), N(kzn_01), "ポイズンパックン,トゲメット,ポイズンパックン"), - BATTLE(N(Formation_14), N(kzn_01), "ポイズンパックン,トゲメット,ポイズンパックン,トゲメット"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kzn_01), "バブルx2"), + BATTLE(A(Formation_01), A(kzn_01), "バブルx3"), + BATTLE(A(Formation_02), A(kzn_01), "バブルx4"), + BATTLE(A(Formation_03), A(kzn_01), "バブル,トゲメットx3"), + BATTLE(A(Formation_04), A(kzn_01), "バブルx2,かいふくヘイホー"), + BATTLE(A(Formation_05), A(kzn_01), "バブルx2,レッドカメック"), + BATTLE(A(Formation_06), A(kzn_01), "バブルx2,ホワイトカメック"), + BATTLE(A(Formation_07), A(kzn_01), "バブルx2,トゲメット"), + BATTLE(A(Formation_08), A(kzn_01), "トゲメットx2"), + BATTLE(A(Formation_09), A(kzn_01), "トゲメット,バブル"), + BATTLE(A(Formation_0A), A(kzn_01), "トゲメットx2,バブル"), + BATTLE(A(Formation_0B), A(kzn_01), "トゲメット,ポイズンパックン"), + BATTLE(A(Formation_0C), A(kzn_01), "トゲメットx2,ポイズンパックン"), + BATTLE(A(Formation_0D), A(kzn_01), "トゲメットx2,ポイズンパックンx2"), + BATTLE(A(Formation_0E), A(kzn_01), "トゲメット,バブルx3"), + BATTLE(A(Formation_0F), A(kzn_01), "ポイズンパックンx2"), + BATTLE(A(Formation_10), A(kzn_01), "ポイズンパックンx3"), + BATTLE(A(Formation_11), A(kzn_01), "ポイズンパックン,バブル,ポイズンパックン"), + BATTLE(A(Formation_12), A(kzn_01), "ポイズンパックンx2,トゲメット"), + BATTLE(A(Formation_13), A(kzn_01), "ポイズンパックン,トゲメット,ポイズンパックン"), + BATTLE(A(Formation_14), A(kzn_01), "ポイズンパックン,トゲメット,ポイズンパックン,トゲメット"), {}, }; -StageList N(Stages) = { - STAGE("kzn_01", N(kzn_01)), - STAGE("kzn_01b", N(kzn_01b)), - STAGE("kzn_02", N(kzn_02)), - STAGE("kzn_04", N(kzn_04)), - STAGE("kzn_04b", N(kzn_04b)), - STAGE("kzn_04c", N(kzn_04c)), - STAGE("kzn_05", N(kzn_05)), +StageList A(Stages) = { + STAGE("kzn_01", A(kzn_01)), + STAGE("kzn_01b", A(kzn_01b)), + STAGE("kzn_02", A(kzn_02)), + STAGE("kzn_04", A(kzn_04)), + STAGE("kzn_04b", A(kzn_04b)), + STAGE("kzn_04c", A(kzn_04c)), + STAGE("kzn_05", A(kzn_05)), {}, }; diff --git a/src/battle/area/kzn/area.h b/src/battle/area/kzn/area.h new file mode 100644 index 0000000000..cfa5857c18 --- /dev/null +++ b/src/battle/area/kzn/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kzn diff --git a/src/battle/area/kzn/stage/kzn_01.c b/src/battle/area/kzn/stage/kzn_01.c index 7086a837d8..0f032d52db 100644 --- a/src/battle/area/kzn/stage/kzn_01.c +++ b/src/battle/area/kzn/stage/kzn_01.c @@ -1,35 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn_kzn_01 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 17, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x0000000E, - 0x0000000F, - 0x00000018, - 0x00000019, - 0x0000001A, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt01_shape", - .hit = "kzn_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_01.inc.c" diff --git a/src/battle/area/kzn/stage/kzn_01b.c b/src/battle/area/kzn/stage/kzn_01b.c index a1188aae34..3f4dd2ad32 100644 --- a/src/battle/area/kzn/stage/kzn_01b.c +++ b/src/battle/area/kzn/stage/kzn_01b.c @@ -1,34 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn_kzn_01b - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x0000000E, - 0x0000000F, - 0x00000018, - 0x00000019, - 0x0000001A, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt01_shape", - .hit = "kzn_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_01b.inc.c" diff --git a/src/battle/area/kzn/stage/kzn_02.c b/src/battle/area/kzn/stage/kzn_02.c index e3be55edb6..1639b497b3 100644 --- a/src/battle/area/kzn/stage/kzn_02.c +++ b/src/battle/area/kzn/stage/kzn_02.c @@ -1,122 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn_kzn_02 - -EvtScript N(802278B0) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022797C) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80227A2C) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 25) - EVT_SET(LVar1, 0) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 6) - EVT_SET(LVar1, 1) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 7) - EVT_SET(LVar1, 2) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 9) - EVT_SET(LVar1, 3) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 10) - EVT_SET(LVar1, 4) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 12) - EVT_SET(LVar1, 5) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 6) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 24) - EVT_SET(LVar1, 180) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, 200) - EVT_EXEC(N(80227A2C)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x0000001E, - 0x0000001F, - 0x00000020, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt02_shape", - .hit = "kzn_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_02.inc.c" diff --git a/src/battle/area/kzn/stage/kzn_04.c b/src/battle/area/kzn/stage/kzn_04.c index 3a0c8e45d9..4410c6c2c4 100644 --- a/src/battle/area/kzn/stage/kzn_04.c +++ b/src/battle/area/kzn/stage/kzn_04.c @@ -1,128 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn_kzn_04 - -EvtScript N(80227DE0) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80227EAC) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80227F5C) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 30, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 44, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 4) - EVT_SET(LVar1, 0) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 5) - EVT_SET(LVar1, 1) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 6) - EVT_SET(LVar1, 2) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 7) - EVT_SET(LVar1, 3) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 15) - EVT_SET(LVar1, 4) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 32) - EVT_SET(LVar1, 5) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 33) - EVT_SET(LVar1, 6) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 43) - EVT_SET(LVar1, 7) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 8) - EVT_EXEC(N(80227EAC)) - EVT_SET(LVar0, 14) - EVT_SET(LVar1, 9) - EVT_EXEC(N(80227EAC)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x00000014, - 0x00000015, - 0x00000016, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt04_shape", - .hit = "kzn_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_04.inc.c" diff --git a/src/battle/area/kzn/stage/kzn_04b.c b/src/battle/area/kzn/stage/kzn_04b.c index 77cf166989..a93a75c5e3 100644 --- a/src/battle/area/kzn/stage/kzn_04b.c +++ b/src/battle/area/kzn/stage/kzn_04b.c @@ -1,128 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn_kzn_04b - -EvtScript N(80228370) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022843C) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802284EC) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 39, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 44, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 4) - EVT_SET(LVar1, 0) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 5) - EVT_SET(LVar1, 1) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 6) - EVT_SET(LVar1, 2) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 7) - EVT_SET(LVar1, 3) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 15) - EVT_SET(LVar1, 4) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 24) - EVT_SET(LVar1, 5) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 25) - EVT_SET(LVar1, 6) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 43) - EVT_SET(LVar1, 7) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 8) - EVT_EXEC(N(8022843C)) - EVT_SET(LVar0, 14) - EVT_SET(LVar1, 9) - EVT_EXEC(N(8022843C)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x00000014, - 0x00000015, - 0x00000016, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt04_shape", - .hit = "kzn_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_04b.inc.c" diff --git a/src/battle/area/kzn/stage/kzn_04c.c b/src/battle/area/kzn/stage/kzn_04c.c index badaa94492..44bf0f1952 100644 --- a/src/battle/area/kzn/stage/kzn_04c.c +++ b/src/battle/area/kzn/stage/kzn_04c.c @@ -1,122 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn_kzn_04c - -EvtScript N(80228900) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802289CC) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80228A7C) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 39, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 30, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 4) - EVT_SET(LVar1, 0) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 5) - EVT_SET(LVar1, 1) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 6) - EVT_SET(LVar1, 2) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 7) - EVT_SET(LVar1, 3) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 15) - EVT_SET(LVar1, 4) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 43) - EVT_SET(LVar1, 7) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 8) - EVT_EXEC(N(802289CC)) - EVT_SET(LVar0, 14) - EVT_SET(LVar1, 9) - EVT_EXEC(N(802289CC)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x00000014, - 0x00000015, - 0x00000016, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt04_shape", - .hit = "kzn_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_04c.inc.c" diff --git a/src/battle/area/kzn/stage/kzn_05.c b/src/battle/area/kzn/stage/kzn_05.c index fad3d070b0..a55ccf7a65 100644 --- a/src/battle/area/kzn/stage/kzn_05.c +++ b/src/battle/area/kzn/stage/kzn_05.c @@ -1,165 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn_kzn_05 - -EvtScript N(80228E40) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80228F0C) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80228FBC) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 17) - EVT_SET(LVar1, 0) - EVT_EXEC(N(80228E40)) - EVT_SET(LVar0, 15) - EVT_SET(LVar1, 1) - EVT_EXEC(N(80228E40)) - EVT_SET(LVar0, 10) - EVT_SET(LVar1, 2) - EVT_EXEC(N(80228F0C)) - EVT_SET(LVar0, 11) - EVT_SET(LVar1, 3) - EVT_EXEC(N(80228F0C)) - EVT_SET(LVar0, 26) - EVT_SET(LVar1, 4) - EVT_EXEC(N(80228F0C)) - EVT_SET(LVar0, 27) - EVT_SET(LVar1, 5) - EVT_EXEC(N(80228F0C)) - EVT_CALL(EnableModel, 29, FALSE) - EVT_CALL(EnableModel, 30, FALSE) - EVT_CALL(EnableModel, 31, FALSE) - EVT_CALL(EnableModel, 32, FALSE) - EVT_CALL(EnableModel, 33, FALSE) - EVT_CALL(EnableModel, 34, FALSE) - EVT_CALL(EnableModel, 35, FALSE) - EVT_CALL(EnableModel, 36, FALSE) - EVT_CALL(EnableModel, 37, FALSE) - EVT_CALL(EnableModel, 38, FALSE) - EVT_CALL(EnableModel, 39, FALSE) - EVT_CALL(EnableModel, 40, FALSE) - EVT_CALL(EnableModel, 41, FALSE) - EVT_CALL(EnableModel, 42, FALSE) - EVT_CALL(EnableModel, 43, FALSE) - EVT_CALL(EnableModel, 44, FALSE) - EVT_CALL(EnableModel, 45, FALSE) - EVT_CALL(EnableModel, 46, FALSE) - EVT_CALL(EnableModel, 47, FALSE) - EVT_CALL(EnableModel, 48, FALSE) - EVT_CALL(EnableModel, 49, FALSE) - EVT_CALL(EnableModel, 50, FALSE) - EVT_CALL(EnableModel, 51, FALSE) - EVT_CALL(EnableModel, 52, FALSE) - EVT_CALL(EnableModel, 53, FALSE) - EVT_CALL(EnableModel, 54, FALSE) - EVT_CALL(EnableModel, 55, FALSE) - EVT_CALL(EnableModel, 56, FALSE) - EVT_CALL(EnableModel, 57, FALSE) - EVT_CALL(EnableModel, 58, FALSE) - EVT_CALL(EnableModel, 59, FALSE) - EVT_CALL(EnableModel, 60, FALSE) - EVT_CALL(EnableModel, 61, FALSE) - EVT_CALL(EnableModel, 62, FALSE) - EVT_CALL(EnableModel, 63, FALSE) - EVT_CALL(EnableModel, 64, FALSE) - EVT_CALL(EnableModel, 65, FALSE) - EVT_CALL(EnableModel, 66, FALSE) - EVT_CALL(EnableModel, 67, FALSE) - EVT_CALL(EnableModel, 68, FALSE) - EVT_CALL(EnableModel, 69, FALSE) - EVT_CALL(EnableModel, 70, FALSE) - EVT_CALL(EnableModel, 71, FALSE) - EVT_CALL(EnableModel, 72, FALSE) - EVT_CALL(EnableModel, 73, FALSE) - EVT_CALL(EnableModel, 74, FALSE) - EVT_CALL(EnableModel, 75, FALSE) - EVT_CALL(EnableModel, 76, FALSE) - EVT_CALL(EnableModel, 78, FALSE) - EVT_CALL(EnableModel, 79, FALSE) - EVT_CALL(EnableModel, 80, FALSE) - EVT_CALL(EnableModel, 81, FALSE) - EVT_CALL(EnableModel, 82, FALSE) - EVT_CALL(EnableModel, 83, FALSE) - EVT_CALL(EnableModel, 84, FALSE) - EVT_CALL(EnableModel, 85, FALSE) - EVT_CALL(EnableModel, 86, FALSE) - EVT_CALL(EnableModel, 87, FALSE) - EVT_CALL(EnableModel, 88, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt05_shape", - .hit = "kzn_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kzn/kzn_05.inc.c" diff --git a/src/battle/area/kzn2/actor/lava_bud.c b/src/battle/area/kzn2/actor/lava_bud.c index 4f0a835803..c61c5814a5 100644 --- a/src/battle/area/kzn2/actor/lava_bud.c +++ b/src/battle/area/kzn2/actor/lava_bud.c @@ -1,12 +1,9 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/LavaBud.h" #include "sprite/npc/PetitPiranha.h" -#include "effects.h" #include "ld_addrs.h" -#define NAMESPACE b_area_kzn2_lava_bud +#define NAMESPACE A(lava_bud) extern EvtScript N(init); extern EvtScript N(idle); @@ -23,10 +20,10 @@ extern EvtScript N(8022630C); API_CALLABLE(SetAnimatorFlags); -extern EvtScript b_area_kzn2_lava_piranha_ignite; +extern EvtScript A(lava_piranha_ignite); -extern ActorBlueprint b_area_kzn2_petit_piranha; -extern ActorBlueprint b_area_kzn2_petit_piranha_bomb; +extern ActorBlueprint A(petit_piranha); +extern ActorBlueprint A(petit_piranha_bomb); extern Formation N(formation_petit_piranha_1); extern Formation N(formation_petit_piranha_2); @@ -283,7 +280,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_EXEC_WAIT(N(onDeath)) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar1) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CASE_EQ(EVENT_SHOCK_DEATH) @@ -305,7 +302,7 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_CALL(SetAnimatorFlags, LVar0, MODEL_ANIMATOR_FLAG_FREEZE_ANIMATION, 0) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -339,7 +336,7 @@ EvtScript N(onBurnHit) = { EVT_ELSE EVT_SET(LVar0, ACTOR_ENEMY2) EVT_END_IF - EVT_EXEC_WAIT(b_area_kzn2_lava_piranha_ignite) + EVT_EXEC_WAIT(A(lava_piranha_ignite)) EVT_LABEL(10) EVT_END_THREAD EVT_CALL(GetActorVar, ACTOR_ENEMY0, 0, LVar0) @@ -445,7 +442,7 @@ EvtScript N(takeTurn) = { EVT_SET(LVar0, ACTOR_ENEMY2) EVT_END_IF EVT_CALL(PlaySoundAtActor, LVar0, SOUND_20BF) - EVT_EXEC_WAIT(b_area_kzn2_lava_piranha_ignite) + EVT_EXEC_WAIT(A(lava_piranha_ignite)) EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_IF_EQ(LVar0, 1) EVT_CALL(OverrideBattleDmaDest, VINE_1_BASE) @@ -547,9 +544,9 @@ EvtScript N(summonPetitPiranha) = { EVT_END_THREAD EVT_WAIT(56) EVT_IF_EQ(LVar0, 1) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_petit_piranha_1)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_petit_piranha_1)), FALSE) EVT_ELSE - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_petit_piranha_2)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_petit_piranha_2)), FALSE) EVT_END_IF EVT_SET(LVar5, LVar0) EVT_CALL(GetActorVar, ACTOR_SELF, 9, LVar0) @@ -606,15 +603,15 @@ EvtScript N(summonPetitPiranha) = { Vec3i N(petit_piranha_pos) = { 260, 0, 0 }; Formation N(formation_petit_piranha_1) = { - ACTOR_BY_POS(b_area_kzn2_petit_piranha, N(petit_piranha_pos), 95, -12, 85), + ACTOR_BY_POS(A(petit_piranha), N(petit_piranha_pos), 95, -12, 85), }; Formation N(formation_petit_piranha_2) = { - ACTOR_BY_POS(b_area_kzn2_petit_piranha, N(petit_piranha_pos), 94, 18, 38), + ACTOR_BY_POS(A(petit_piranha), N(petit_piranha_pos), 94, 18, 38), }; Formation N(formation_petit_piranha_bomb) = { - ACTOR_BY_POS(b_area_kzn2_petit_piranha_bomb, N(petit_piranha_pos), 95), + ACTOR_BY_POS(A(petit_piranha_bomb), N(petit_piranha_pos), 95), }; EvtScript N(onDeath) = { @@ -1012,7 +1009,7 @@ EvtScript N(attackPetitSpit) = { EVT_EXEC_WAIT(N(playModelAnimation)) EVT_END_THREAD EVT_WAIT(56) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_petit_piranha_bomb)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_petit_piranha_bomb)), FALSE) EVT_SET(LVar5, LVar0) EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_MAIN, LVar0, LVar1, LVar2) EVT_SUB(LVar0, 15) diff --git a/src/battle/area/kzn2/actor/lava_piranha.c b/src/battle/area/kzn2/actor/lava_piranha.c index c7d6c6dd0a..b0fd295328 100644 --- a/src/battle/area/kzn2/actor/lava_piranha.c +++ b/src/battle/area/kzn2/actor/lava_piranha.c @@ -1,16 +1,13 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/LavaPiranha.h" #include "sprite/npc/BattleKolorado.h" #include "sprite/npc/LavaBud.h" #include "sprite/npc/PetitPiranha.h" -#include "effects.h" #include "animation_script.h" #include "entity.h" #include "ld_addrs.h" -#define NAMESPACE b_area_kzn2_lava_piranha +#define NAMESPACE A(lava_piranha) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -116,16 +113,16 @@ extern EvtScript N(attackFireStream); extern EvtScript N(handleBudDeath); extern EvtScript N(doOnHit); -extern ActorBlueprint b_area_kzn2_lava_bud; +extern ActorBlueprint A(lava_bud); extern StaticAnimatorNode* N(anim1)[]; extern StaticAnimatorNode* N(AnimModel_MainHeadVine)[]; extern StaticAnimatorNode* N(AnimModel_SideHeadVine)[]; extern StaticAnimatorNode* N(AnimModel_ExtraVine)[]; extern AnimScript N(anim1_8021A364); -extern s32 b_area_kzn2_lava_bud_IdleAnimations_fiery[]; +extern s32 A(lava_bud_IdleAnimations_fiery)[]; extern s32 N(DefenseTable_fiery)[]; -extern s32 b_area_kzn2_lava_bud_DefenseTable_fiery[]; +extern s32 A(lava_bud_DefenseTable_fiery)[]; API_CALLABLE(SetAnimatorFlags); API_CALLABLE(GetAnimatedPositionByTreeIndex); @@ -583,8 +580,8 @@ EvtScript N(init) = { EVT_CALL(PlayModelAnimation, VINE_3, VINE_3_BASE) EVT_CALL(SetAnimatedModelRootPosition, VINE_3, 0, 0, 3) EVT_CALL(SetAnimatorFlags, VINE_3, MODEL_ANIMATOR_FLAG_HIDDEN, 1) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_lava_bud_1)), 0) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_lava_bud_2)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_lava_bud_1)), FALSE) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_lava_bud_2)), FALSE) EVT_WAIT(2) EVT_EXEC(N(initVines)) EVT_CALL(CreateNpc, NPC_BTL_COMPANION, ANIM_BattleKolorado_Idle) @@ -982,7 +979,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaPiranha_Anim09) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CASE_EQ(EVENT_SHOCK_DEATH) @@ -1004,7 +1001,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_RECOVER_STATUS) EVT_CALL(SetAnimatorFlags, VINE_0, MODEL_ANIMATOR_FLAG_FREEZE_ANIMATION, 0) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaPiranha_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -1125,11 +1122,11 @@ EvtScript N(takeTurn) = { Vec3i N(lava_bud_pos) = { 260, 0, 0 }; Formation N(formation_lava_bud_1) = { - ACTOR_BY_POS(b_area_kzn2_lava_bud, N(lava_bud_pos), 80, 1), + ACTOR_BY_POS(A(lava_bud), N(lava_bud_pos), 80, 1), }; Formation N(formation_lava_bud_2) = { - ACTOR_BY_POS(b_area_kzn2_lava_bud, N(lava_bud_pos), 70, 2, 50, 14, 20), + ACTOR_BY_POS(A(lava_bud), N(lava_bud_pos), 70, 2, 50, 14, 20), }; EvtScript N(attackFlameSpew) = { @@ -1543,15 +1540,15 @@ EvtScript N(onDeath) = { EVT_CALL(SetActorVar, ACTOR_ENEMY1, 8, ANIM_LavaBud_Anim0B) EVT_CALL(SetActorVar, ACTOR_ENEMY2, 7, ANIM_LavaBud_Anim04) EVT_CALL(SetActorVar, ACTOR_ENEMY2, 8, ANIM_LavaBud_Anim0B) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(b_area_kzn2_lava_bud_IdleAnimations_fiery)) - EVT_CALL(SetIdleAnimations, ACTOR_ENEMY1, PRT_MAIN, EVT_PTR(b_area_kzn2_lava_bud_IdleAnimations_fiery)) - EVT_CALL(SetIdleAnimations, ACTOR_ENEMY2, PRT_MAIN, EVT_PTR(b_area_kzn2_lava_bud_IdleAnimations_fiery)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(A(lava_bud_IdleAnimations_fiery))) + EVT_CALL(SetIdleAnimations, ACTOR_ENEMY1, PRT_MAIN, EVT_PTR(A(lava_bud_IdleAnimations_fiery))) + EVT_CALL(SetIdleAnimations, ACTOR_ENEMY2, PRT_MAIN, EVT_PTR(A(lava_bud_IdleAnimations_fiery))) EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_fiery))) EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_2, EVT_PTR(N(DefenseTable_fiery))) - EVT_CALL(SetDefenseTable, ACTOR_ENEMY1, PRT_MAIN, EVT_PTR(b_area_kzn2_lava_bud_DefenseTable_fiery)) - EVT_CALL(SetDefenseTable, ACTOR_ENEMY1, PRT_2, EVT_PTR(b_area_kzn2_lava_bud_DefenseTable_fiery)) - EVT_CALL(SetDefenseTable, ACTOR_ENEMY2, PRT_MAIN, EVT_PTR(b_area_kzn2_lava_bud_DefenseTable_fiery)) - EVT_CALL(SetDefenseTable, ACTOR_ENEMY2, PRT_2, EVT_PTR(b_area_kzn2_lava_bud_DefenseTable_fiery)) + EVT_CALL(SetDefenseTable, ACTOR_ENEMY1, PRT_MAIN, EVT_PTR(A(lava_bud_DefenseTable_fiery))) + EVT_CALL(SetDefenseTable, ACTOR_ENEMY1, PRT_2, EVT_PTR(A(lava_bud_DefenseTable_fiery))) + EVT_CALL(SetDefenseTable, ACTOR_ENEMY2, PRT_MAIN, EVT_PTR(A(lava_bud_DefenseTable_fiery))) + EVT_CALL(SetDefenseTable, ACTOR_ENEMY2, PRT_2, EVT_PTR(A(lava_bud_DefenseTable_fiery))) EVT_CALL(SetPartImmunityBits, ACTOR_SELF, 1, ELEMENT_FIRE, 1) EVT_CALL(SetPartImmunityBits, ACTOR_SELF, 2, ELEMENT_FIRE, 1) EVT_CALL(SetPartImmunityBits, ACTOR_ENEMY1, 1, ELEMENT_FIRE, 1) @@ -1893,9 +1890,9 @@ EvtScript N(ignite) = { EVT_SUB(LVar2, 3) EVT_PLAY_EFFECT(EFFECT_FLAME, 1, LVar3, LVar4, LVar2, EVT_FLOAT(0.3), LVarA, 0) EVT_CALL(SetActorVar, ACTOR_ENEMY1, 6, LVarA) - EVT_CALL(SetIdleAnimations, ACTOR_ENEMY1, PRT_MAIN, EVT_PTR(b_area_kzn2_lava_bud_IdleAnimations_fiery)) - EVT_CALL(SetDefenseTable, ACTOR_ENEMY1, PRT_MAIN, EVT_PTR(b_area_kzn2_lava_bud_DefenseTable_fiery)) - EVT_CALL(SetDefenseTable, ACTOR_ENEMY1, PRT_2, EVT_PTR(b_area_kzn2_lava_bud_DefenseTable_fiery)) + EVT_CALL(SetIdleAnimations, ACTOR_ENEMY1, PRT_MAIN, EVT_PTR(A(lava_bud_IdleAnimations_fiery))) + EVT_CALL(SetDefenseTable, ACTOR_ENEMY1, PRT_MAIN, EVT_PTR(A(lava_bud_DefenseTable_fiery))) + EVT_CALL(SetDefenseTable, ACTOR_ENEMY1, PRT_2, EVT_PTR(A(lava_bud_DefenseTable_fiery))) EVT_CALL(SetPartEventBits, ACTOR_ENEMY1, PRT_MAIN, ACTOR_EVENT_FLAG_FIREY, TRUE) EVT_CALL(SetPartEventBits, ACTOR_ENEMY1, PRT_2, ACTOR_EVENT_FLAG_FIREY, TRUE) EVT_CALL(SetActorVar, ACTOR_ENEMY1, 7, ANIM_LavaBud_Anim04) @@ -1914,9 +1911,9 @@ EvtScript N(ignite) = { EVT_SUB(LVar2, 3) EVT_PLAY_EFFECT(EFFECT_FLAME, 1, LVar3, LVar4, LVar2, EVT_FLOAT(0.3), LVarA, 0) EVT_CALL(SetActorVar, ACTOR_ENEMY2, 6, LVarA) - EVT_CALL(SetIdleAnimations, ACTOR_ENEMY2, PRT_MAIN, EVT_PTR(b_area_kzn2_lava_bud_IdleAnimations_fiery)) - EVT_CALL(SetDefenseTable, ACTOR_ENEMY2, PRT_MAIN, EVT_PTR(b_area_kzn2_lava_bud_DefenseTable_fiery)) - EVT_CALL(SetDefenseTable, ACTOR_ENEMY2, PRT_2, EVT_PTR(b_area_kzn2_lava_bud_DefenseTable_fiery)) + EVT_CALL(SetIdleAnimations, ACTOR_ENEMY2, PRT_MAIN, EVT_PTR(A(lava_bud_IdleAnimations_fiery))) + EVT_CALL(SetDefenseTable, ACTOR_ENEMY2, PRT_MAIN, EVT_PTR(A(lava_bud_DefenseTable_fiery))) + EVT_CALL(SetDefenseTable, ACTOR_ENEMY2, PRT_2, EVT_PTR(A(lava_bud_DefenseTable_fiery))) EVT_CALL(SetPartEventBits, ACTOR_ENEMY2, PRT_MAIN, ACTOR_EVENT_FLAG_FIREY, TRUE) EVT_CALL(SetPartEventBits, ACTOR_ENEMY2, PRT_2, ACTOR_EVENT_FLAG_FIREY, TRUE) EVT_CALL(SetActorVar, ACTOR_ENEMY2, 7, ANIM_LavaBud_Anim04) diff --git a/src/battle/area/kzn2/actor/petit_piranha.c b/src/battle/area/kzn2/actor/petit_piranha.c index fc8a632a96..e59ef77661 100644 --- a/src/battle/area/kzn2/actor/petit_piranha.c +++ b/src/battle/area/kzn2/actor/petit_piranha.c @@ -1,10 +1,8 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/PetitPiranha.h" #include "effects.h" -#define NAMESPACE b_area_kzn2_petit_piranha +#define NAMESPACE A(petit_piranha) extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -127,56 +125,56 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) EVT_EXEC_WAIT(N(onDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(onDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_EXEC_WAIT(N(onDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP @@ -186,22 +184,22 @@ EvtScript N(handleEvent) = { EVT_WAIT(60) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) EVT_EXEC_WAIT(N(onDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_PetitPiranha_Anim03) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) diff --git a/src/battle/area/kzn2/actor/petit_piranha_bomb.c b/src/battle/area/kzn2/actor/petit_piranha_bomb.c index 85eb46eb77..427761567a 100644 --- a/src/battle/area/kzn2/actor/petit_piranha_bomb.c +++ b/src/battle/area/kzn2/actor/petit_piranha_bomb.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/PetitPiranha.h" -#define NAMESPACE b_area_kzn2_petit_piranha_bomb +#define NAMESPACE A(petit_piranha_bomb) extern EvtScript N(init); extern EvtScript N(idle); diff --git a/src/battle/area/kzn2/anim/lava_piranha_anim1.inc.c b/src/battle/area/kzn2/anim/lava_piranha_anim1.inc.c index 5436d4921f..5006d958f1 100644 --- a/src/battle/area/kzn2/anim/lava_piranha_anim1.inc.c +++ b/src/battle/area/kzn2/anim/lava_piranha_anim1.inc.c @@ -1,7 +1,7 @@ -#include "common.h" +#include "../area.h" #include "animation_script.h" -#define NAMESPACE b_area_kzn2_lava_piranha_anim1 +#define NAMESPACE A(lava_piranha_anim1) StaticAnimatorNode N(8021A120) = { .vertexStartOffset = -1, diff --git a/src/battle/area/kzn2/anim/lava_piranha_anim2.inc.c b/src/battle/area/kzn2/anim/lava_piranha_anim2.inc.c index b494c1bb27..3842e44335 100644 --- a/src/battle/area/kzn2/anim/lava_piranha_anim2.inc.c +++ b/src/battle/area/kzn2/anim/lava_piranha_anim2.inc.c @@ -1,6 +1,6 @@ -#include "common.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_lava_piranha_AnimModel_MainHeadVine +#define NAMESPACE A(lava_piranha_AnimModel_MainHeadVine) s32 N(padding) = 0; diff --git a/src/battle/area/kzn2/anim/lava_piranha_anim3.inc.c b/src/battle/area/kzn2/anim/lava_piranha_anim3.inc.c index 8bbaf26d3a..7c95742f41 100644 --- a/src/battle/area/kzn2/anim/lava_piranha_anim3.inc.c +++ b/src/battle/area/kzn2/anim/lava_piranha_anim3.inc.c @@ -1,6 +1,6 @@ -#include "common.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_lava_piranha_AnimModel_SideHeadVine +#define NAMESPACE A(lava_piranha_AnimModel_SideHeadVine) s32 N(padding) = 0; diff --git a/src/battle/area/kzn2/anim/lava_piranha_anim4.inc.c b/src/battle/area/kzn2/anim/lava_piranha_anim4.inc.c index 03544d2ead..30a5563895 100644 --- a/src/battle/area/kzn2/anim/lava_piranha_anim4.inc.c +++ b/src/battle/area/kzn2/anim/lava_piranha_anim4.inc.c @@ -1,6 +1,6 @@ -#include "common.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_lava_piranha_AnimModel_ExtraVine +#define NAMESPACE A(lava_piranha_AnimModel_ExtraVine) s32 N(padding) = 0; diff --git a/src/battle/area/kzn2/area.c b/src/battle/area/kzn2/area.c index cf6fc85b74..08aa426f69 100644 --- a/src/battle/area/kzn2/area.c +++ b/src/battle/area/kzn2/area.c @@ -1,48 +1,45 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" #include "ld_addrs.h" -#define NAMESPACE b_area_kzn2 +extern ActorBlueprint A(lava_piranha); +extern ActorBlueprint A(petit_piranha); -extern ActorBlueprint N(lava_piranha); -extern ActorBlueprint N(petit_piranha); +extern Stage A(kzn_01); +extern Stage A(kzn_01b); +extern Stage A(kzn_02); +extern Stage A(kzn_04); +extern Stage A(kzn_04b); +extern Stage A(kzn_04c); +extern Stage A(kzn_05); -extern Stage N(kzn_01); -extern Stage N(kzn_01b); -extern Stage N(kzn_02); -extern Stage N(kzn_04); -extern Stage N(kzn_04b); -extern Stage N(kzn_04c); -extern Stage N(kzn_05); +Vec3i A(lava_piranha_pos) = { 60, 60, 0 }; -Vec3i N(lava_piranha_pos) = { 60, 60, 0 }; - -Formation N(Formation_00) = { - ACTOR_BY_POS(N(lava_piranha), N(lava_piranha_pos), 60), +Formation A(Formation_00) = { + ACTOR_BY_POS(A(lava_piranha), A(lava_piranha_pos), 60), }; -Vec3i N(petit_piranha_pos1) = { 40, 60, 0 }; -Vec3i N(petit_piranha_pos2) = { 80, 60, 0 }; +Vec3i A(petit_piranha_pos1) = { 40, 60, 0 }; +Vec3i A(petit_piranha_pos2) = { 80, 60, 0 }; -Formation N(Formation_01) = { - ACTOR_BY_POS(N(petit_piranha), N(petit_piranha_pos1), 10), - ACTOR_BY_POS(N(petit_piranha), N(petit_piranha_pos2), 10), +Formation A(Formation_01) = { + ACTOR_BY_POS(A(petit_piranha), A(petit_piranha_pos1), 10), + ACTOR_BY_POS(A(petit_piranha), A(petit_piranha_pos2), 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(kzn_05), "ファイアパックン"), - BATTLE(N(Formation_01), N(kzn_05), "プチパックン"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(kzn_05), "ファイアパックン"), + BATTLE(A(Formation_01), A(kzn_05), "プチパックン"), {}, }; -StageList N(Stages) = { - STAGE("kzn_01", N(kzn_01)), - STAGE("kzn_01b", N(kzn_01b)), - STAGE("kzn_02", N(kzn_02)), - STAGE("kzn_04", N(kzn_04)), - STAGE("kzn_04b", N(kzn_04b)), - STAGE("kzn_04c", N(kzn_04c)), - STAGE("kzn_05", N(kzn_05)), +StageList A(Stages) = { + STAGE("kzn_01", A(kzn_01)), + STAGE("kzn_01b", A(kzn_01b)), + STAGE("kzn_02", A(kzn_02)), + STAGE("kzn_04", A(kzn_04)), + STAGE("kzn_04b", A(kzn_04b)), + STAGE("kzn_04c", A(kzn_04c)), + STAGE("kzn_05", A(kzn_05)), {}, }; @@ -51,7 +48,7 @@ StageList N(Stages) = { world_model_anim_kzn_##name##_ROM_END,\ world_model_anim_kzn_##name##_VRAM } -DmaTable N(dmaTable)[] = { +DmaTable A(dmaTable)[] = { PIRANHA_DMA_ENTRY(00), PIRANHA_DMA_ENTRY(01), PIRANHA_DMA_ENTRY(02), diff --git a/src/battle/area/kzn2/area.h b/src/battle/area/kzn2/area.h new file mode 100644 index 0000000000..33bec3cf56 --- /dev/null +++ b/src/battle/area/kzn2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_kzn2 diff --git a/src/battle/area/kzn2/stage/kzn_01.c b/src/battle/area/kzn2/stage/kzn_01.c index ee2f0e6d3e..0f032d52db 100644 --- a/src/battle/area/kzn2/stage/kzn_01.c +++ b/src/battle/area/kzn2/stage/kzn_01.c @@ -1,35 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_kzn_01 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 17, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x0000000E, - 0x0000000F, - 0x00000018, - 0x00000019, - 0x0000001A, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt01_shape", - .hit = "kzn_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_01.inc.c" diff --git a/src/battle/area/kzn2/stage/kzn_01b.c b/src/battle/area/kzn2/stage/kzn_01b.c index 46c214633b..3f4dd2ad32 100644 --- a/src/battle/area/kzn2/stage/kzn_01b.c +++ b/src/battle/area/kzn2/stage/kzn_01b.c @@ -1,34 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_kzn_01b - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x0000000E, - 0x0000000F, - 0x00000018, - 0x00000019, - 0x0000001A, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt01_shape", - .hit = "kzn_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_01b.inc.c" diff --git a/src/battle/area/kzn2/stage/kzn_02.c b/src/battle/area/kzn2/stage/kzn_02.c index 11610e5e35..1639b497b3 100644 --- a/src/battle/area/kzn2/stage/kzn_02.c +++ b/src/battle/area/kzn2/stage/kzn_02.c @@ -1,122 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_kzn_02 - -EvtScript N(802278B0) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022797C) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80227A2C) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 25) - EVT_SET(LVar1, 0) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 6) - EVT_SET(LVar1, 1) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 7) - EVT_SET(LVar1, 2) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 9) - EVT_SET(LVar1, 3) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 10) - EVT_SET(LVar1, 4) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 12) - EVT_SET(LVar1, 5) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 6) - EVT_EXEC(N(802278B0)) - EVT_SET(LVar0, 24) - EVT_SET(LVar1, 180) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, 200) - EVT_EXEC(N(80227A2C)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x0000001E, - 0x0000001F, - 0x00000020, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt02_shape", - .hit = "kzn_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_02.inc.c" diff --git a/src/battle/area/kzn2/stage/kzn_04.c b/src/battle/area/kzn2/stage/kzn_04.c index 9a8417efea..4410c6c2c4 100644 --- a/src/battle/area/kzn2/stage/kzn_04.c +++ b/src/battle/area/kzn2/stage/kzn_04.c @@ -1,128 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_kzn_04 - -EvtScript N(80227DE0) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80227EAC) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80227F5C) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 30, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 44, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 4) - EVT_SET(LVar1, 0) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 5) - EVT_SET(LVar1, 1) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 6) - EVT_SET(LVar1, 2) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 7) - EVT_SET(LVar1, 3) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 15) - EVT_SET(LVar1, 4) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 32) - EVT_SET(LVar1, 5) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 33) - EVT_SET(LVar1, 6) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 43) - EVT_SET(LVar1, 7) - EVT_EXEC(N(80227DE0)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 8) - EVT_EXEC(N(80227EAC)) - EVT_SET(LVar0, 14) - EVT_SET(LVar1, 9) - EVT_EXEC(N(80227EAC)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x00000014, - 0x00000015, - 0x00000016, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt04_shape", - .hit = "kzn_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_04.inc.c" diff --git a/src/battle/area/kzn2/stage/kzn_04b.c b/src/battle/area/kzn2/stage/kzn_04b.c index 11183fdd7d..a93a75c5e3 100644 --- a/src/battle/area/kzn2/stage/kzn_04b.c +++ b/src/battle/area/kzn2/stage/kzn_04b.c @@ -1,128 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_kzn_04b - -EvtScript N(80228370) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8022843C) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802284EC) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 39, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 44, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 4) - EVT_SET(LVar1, 0) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 5) - EVT_SET(LVar1, 1) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 6) - EVT_SET(LVar1, 2) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 7) - EVT_SET(LVar1, 3) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 15) - EVT_SET(LVar1, 4) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 24) - EVT_SET(LVar1, 5) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 25) - EVT_SET(LVar1, 6) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 43) - EVT_SET(LVar1, 7) - EVT_EXEC(N(80228370)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 8) - EVT_EXEC(N(8022843C)) - EVT_SET(LVar0, 14) - EVT_SET(LVar1, 9) - EVT_EXEC(N(8022843C)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x00000014, - 0x00000015, - 0x00000016, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt04_shape", - .hit = "kzn_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_04b.inc.c" diff --git a/src/battle/area/kzn2/stage/kzn_04c.c b/src/battle/area/kzn2/stage/kzn_04c.c index a00276fcf5..44bf0f1952 100644 --- a/src/battle/area/kzn2/stage/kzn_04c.c +++ b/src/battle/area/kzn2/stage/kzn_04c.c @@ -1,122 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_kzn_04c - -EvtScript N(80228900) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802289CC) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80228A7C) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 39, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 30, MODEL_GROUP_HIDDEN) - EVT_SET(LVar0, 4) - EVT_SET(LVar1, 0) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 5) - EVT_SET(LVar1, 1) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 6) - EVT_SET(LVar1, 2) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 7) - EVT_SET(LVar1, 3) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 15) - EVT_SET(LVar1, 4) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 43) - EVT_SET(LVar1, 7) - EVT_EXEC(N(80228900)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 8) - EVT_EXEC(N(802289CC)) - EVT_SET(LVar0, 14) - EVT_SET(LVar1, 9) - EVT_EXEC(N(802289CC)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x00000014, - 0x00000015, - 0x00000016, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt04_shape", - .hit = "kzn_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_kzn/kzn_04c.inc.c" diff --git a/src/battle/area/kzn2/stage/kzn_05.c b/src/battle/area/kzn2/stage/kzn_05.c index 3c8c0d57cf..a55ccf7a65 100644 --- a/src/battle/area/kzn2/stage/kzn_05.c +++ b/src/battle/area/kzn2/stage/kzn_05.c @@ -1,165 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_kzn2_kzn_05 - -EvtScript N(80228E40) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_SUB(LVar0, -300) - EVT_SUB(LVar1, -500) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80228F0C) = { - EVT_SET(LVarA, LVar1) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, 16384) - EVT_ADD(LVar1, 0) - EVT_WAIT(5) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80228FBC) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_SET(LVar7, LVar3) - EVT_LABEL(0) - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_SET(LVar2, LVar8) - EVT_ADD(LVar2, LVar9) - EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 17) - EVT_SET(LVar1, 0) - EVT_EXEC(N(80228E40)) - EVT_SET(LVar0, 15) - EVT_SET(LVar1, 1) - EVT_EXEC(N(80228E40)) - EVT_SET(LVar0, 10) - EVT_SET(LVar1, 2) - EVT_EXEC(N(80228F0C)) - EVT_SET(LVar0, 11) - EVT_SET(LVar1, 3) - EVT_EXEC(N(80228F0C)) - EVT_SET(LVar0, 26) - EVT_SET(LVar1, 4) - EVT_EXEC(N(80228F0C)) - EVT_SET(LVar0, 27) - EVT_SET(LVar1, 5) - EVT_EXEC(N(80228F0C)) - EVT_CALL(EnableModel, 29, FALSE) - EVT_CALL(EnableModel, 30, FALSE) - EVT_CALL(EnableModel, 31, FALSE) - EVT_CALL(EnableModel, 32, FALSE) - EVT_CALL(EnableModel, 33, FALSE) - EVT_CALL(EnableModel, 34, FALSE) - EVT_CALL(EnableModel, 35, FALSE) - EVT_CALL(EnableModel, 36, FALSE) - EVT_CALL(EnableModel, 37, FALSE) - EVT_CALL(EnableModel, 38, FALSE) - EVT_CALL(EnableModel, 39, FALSE) - EVT_CALL(EnableModel, 40, FALSE) - EVT_CALL(EnableModel, 41, FALSE) - EVT_CALL(EnableModel, 42, FALSE) - EVT_CALL(EnableModel, 43, FALSE) - EVT_CALL(EnableModel, 44, FALSE) - EVT_CALL(EnableModel, 45, FALSE) - EVT_CALL(EnableModel, 46, FALSE) - EVT_CALL(EnableModel, 47, FALSE) - EVT_CALL(EnableModel, 48, FALSE) - EVT_CALL(EnableModel, 49, FALSE) - EVT_CALL(EnableModel, 50, FALSE) - EVT_CALL(EnableModel, 51, FALSE) - EVT_CALL(EnableModel, 52, FALSE) - EVT_CALL(EnableModel, 53, FALSE) - EVT_CALL(EnableModel, 54, FALSE) - EVT_CALL(EnableModel, 55, FALSE) - EVT_CALL(EnableModel, 56, FALSE) - EVT_CALL(EnableModel, 57, FALSE) - EVT_CALL(EnableModel, 58, FALSE) - EVT_CALL(EnableModel, 59, FALSE) - EVT_CALL(EnableModel, 60, FALSE) - EVT_CALL(EnableModel, 61, FALSE) - EVT_CALL(EnableModel, 62, FALSE) - EVT_CALL(EnableModel, 63, FALSE) - EVT_CALL(EnableModel, 64, FALSE) - EVT_CALL(EnableModel, 65, FALSE) - EVT_CALL(EnableModel, 66, FALSE) - EVT_CALL(EnableModel, 67, FALSE) - EVT_CALL(EnableModel, 68, FALSE) - EVT_CALL(EnableModel, 69, FALSE) - EVT_CALL(EnableModel, 70, FALSE) - EVT_CALL(EnableModel, 71, FALSE) - EVT_CALL(EnableModel, 72, FALSE) - EVT_CALL(EnableModel, 73, FALSE) - EVT_CALL(EnableModel, 74, FALSE) - EVT_CALL(EnableModel, 75, FALSE) - EVT_CALL(EnableModel, 76, FALSE) - EVT_CALL(EnableModel, 78, FALSE) - EVT_CALL(EnableModel, 79, FALSE) - EVT_CALL(EnableModel, 80, FALSE) - EVT_CALL(EnableModel, 81, FALSE) - EVT_CALL(EnableModel, 82, FALSE) - EVT_CALL(EnableModel, 83, FALSE) - EVT_CALL(EnableModel, 84, FALSE) - EVT_CALL(EnableModel, 85, FALSE) - EVT_CALL(EnableModel, 86, FALSE) - EVT_CALL(EnableModel, 87, FALSE) - EVT_CALL(EnableModel, 88, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "kzn_tex", - .shape = "kzn_bt05_shape", - .hit = "kzn_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_kzn/kzn_05.inc.c" diff --git a/src/battle/area/mac/actor/chan.c b/src/battle/area/mac/actor/chan.c index 8baa67d824..167ee23ddc 100644 --- a/src/battle/area/mac/actor/chan.c +++ b/src/battle/area/mac/actor/chan.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/Chan.h" -#define NAMESPACE b_area_mac_chan +#define NAMESPACE A(chan) extern s32 N(IdleAnimations_80219EBC)[]; extern EvtScript N(init_8021CCDC); @@ -223,58 +221,58 @@ EvtScript N(handleEvent_8021A560) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(9) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021A12C)) EVT_CASE_EQ(13) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(8021A12C)) EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021A12C)) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(23) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_EnterShell) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(25) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_EnterShell) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_WAIT(2) @@ -283,18 +281,18 @@ EvtScript N(handleEvent_8021A560) = { EVT_EXEC_WAIT(N(8021A12C)) EVT_END_IF EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) EVT_CASE_EQ(57) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, TRUE) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Run) EVT_SET_CONST(LVar2, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -329,7 +327,7 @@ EvtScript N(handleEvent_8021AAB8) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_ToppledHurt) EVT_EXEC_WAIT(N(8021AA1C)) @@ -338,12 +336,12 @@ EvtScript N(handleEvent_8021AAB8) = { EVT_CASE_EQ(14) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_NE(LVar0, 2) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_ToppledBurnHurt) EVT_SET_CONST(LVar2, ANIM_Chan_ToppledBurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -351,25 +349,25 @@ EvtScript N(handleEvent_8021AAB8) = { EVT_CASE_EQ(36) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_NE(LVar0, 2) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_ELSE - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_ToppledBurnHurt) EVT_SET_CONST(LVar2, ANIM_Chan_ToppledBurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_ToppledBurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_IF EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_ToppledHurt) EVT_EXEC_WAIT(N(8021AA1C)) @@ -408,46 +406,46 @@ EvtScript N(handleEvent_8021AAB8) = { EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Chan_ToppledHurt) EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(23) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_EnterShell) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Chan_ExitShell) EVT_WAIT(8) EVT_ELSE - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Toppled) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(25) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_EnterShell) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Chan_ExitShell) EVT_WAIT(8) EVT_ELSE - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Toppled) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF @@ -455,7 +453,7 @@ EvtScript N(handleEvent_8021AAB8) = { EVT_WAIT(10) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, 0x80000) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_ADD(LVar1, 9) EVT_ELSE EVT_ADD(LVar1, 24) @@ -463,25 +461,25 @@ EvtScript N(handleEvent_8021AAB8) = { EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) EVT_WAIT(20) EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_ToppledHurt) EVT_EXEC_WAIT(N(8021AA1C)) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_ToppledHurt) EVT_EXEC_WAIT(N(8021AA1C)) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_ToppledHurt) EVT_EXEC_WAIT(N(8021AA1C)) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_SET_CONST(LVar2, ANIM_Chan_ToppledHurt) EVT_EXEC_WAIT(N(8021AA1C)) @@ -490,40 +488,40 @@ EvtScript N(handleEvent_8021AAB8) = { EVT_CASE_EQ(49) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_END_IF EVT_CASE_EQ(57) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Run) EVT_SET_CONST(LVar2, ANIM_Chan_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Toppled) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(58) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Run) EVT_ELSE - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Toppled) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Hurt) EVT_ELSE - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_ToppledHurt) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_BlowAway) @@ -531,13 +529,13 @@ EvtScript N(handleEvent_8021AAB8) = { EVT_CASE_EQ(31) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_EnterShell) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Chan_ExitShell) EVT_WAIT(8) EVT_ELSE - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Toppled) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF @@ -677,7 +675,7 @@ EvtScript N(takeTurn_8021B81C) = { EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) EVT_WAIT(8) EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Chan_Idle) @@ -707,7 +705,7 @@ EvtScript N(takeTurn_Chan) = { EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) EVT_WAIT(20) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Toppled) EVT_SET_CONST(LVar2, ANIM_Chan_Idle) EVT_EXEC_WAIT(EVS_Enemy_FlipBackUp) @@ -814,7 +812,7 @@ EvtScript N(takeTurn_Chan) = { EVT_WAIT(8) EVT_CALL(YieldTurn) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Chan_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Chan_Idle) @@ -860,7 +858,7 @@ EvtScript N(nextTurn_8021CD7C) = { EVT_BREAK_SWITCH EVT_END_IF EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x37100A) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO | STATUS_FLAG_POISON | STATUS_KEY_SHRINK) // @bug STATUS_KEY_SHRINK used instead of STATUS_FLAG_SHRINK EVT_BREAK_SWITCH EVT_END_IF EVT_SET_CONST(LVarA, ANIM_Chan_Run) @@ -907,7 +905,7 @@ EvtScript N(handleEvent_8021D0CC) = { EVT_BREAK_SWITCH EVT_END_IF EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x3F1000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO | STATUS_FLAG_POISON | STATUS_FLAG_SHRINK) EVT_BREAK_SWITCH EVT_END_IF EVT_SET(LFlag0, FALSE) diff --git a/src/battle/area/mac/actor/lee.c b/src/battle/area/mac/actor/lee.c index 2d8fa3be86..eae8c6ebdf 100644 --- a/src/battle/area/mac/actor/lee.c +++ b/src/battle/area/mac/actor/lee.c @@ -1,6 +1,4 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/Lee.h" #include "sprite/npc/BattleBombette.h" #include "sprite/npc/BattleBow.h" @@ -11,7 +9,7 @@ #include "sprite/npc/BattleSushie.h" #include "sprite/npc/BattleWatt.h" -#define NAMESPACE b_area_mac_lee +#define NAMESPACE A(lee) extern EvtScript N(init_8021D4C8); extern EvtScript N(takeTurn_80229F9C); @@ -155,7 +153,7 @@ EvtScript N(idle_8021D5B4) = { }; EvtScript N(8021D5C4) = { - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_RETURN @@ -170,85 +168,85 @@ EvtScript N(handleEvent_8021D600) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Burned) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Burned) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Burned) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(8021D5C4)) EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Run) EVT_SET_CONST(LVar2, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Lee_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -306,7 +304,7 @@ EvtScript N(flyingTackle) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lee_Midair) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x80000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) EVT_CALL(AddGoalPos, ACTOR_SELF, EVT_FLOAT(4.0), EVT_FLOAT(-6.0), 0) EVT_ELSE EVT_CALL(AddGoalPos, ACTOR_SELF, 10, -15, 0) @@ -566,41 +564,41 @@ EvtScript N(handleEvent_8021EB24) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_BurnHurt1) EVT_SET_CONST(LVar2, ANIM_BattleGoombario_BurnHurt2) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_BurnHurt1) EVT_SET_CONST(LVar2, ANIM_BattleGoombario_BurnHurt2) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E0E0)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_BurnHurt2) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_SET(LVar2, 12) EVT_EXEC_WAIT(N(8021E5DC)) @@ -610,47 +608,47 @@ EvtScript N(handleEvent_8021EB24) = { EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CASE_EQ(38) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_SET(LVar2, 12) EVT_EXEC_WAIT(N(8021E5DC)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Run) EVT_SET_CONST(LVar2, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -685,7 +683,7 @@ EvtScript N(8021F08C) = { EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x80000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) EVT_SETF(LVar5, EVT_FLOAT(7.2)) EVT_ELSE EVT_SET(LVar5, 18) @@ -1065,7 +1063,7 @@ EvtScript N(nextTurn_80220450) = { EVT_CALL(SetActorVar, ACTOR_SELF, 2, LVar0) EVT_BREAK_SWITCH EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(N(8021E118)) EVT_RETURN @@ -1196,9 +1194,9 @@ EvtScript N(init_Kooper) = { EVT_END }; -#define NAMESPACE b_area_mac_lee_kooper +#define NAMESPACE A(lee_kooper) #include "common/battle/SetAbsoluteStatusOffsets.inc.c" -#define NAMESPACE b_area_mac_lee +#define NAMESPACE A(lee) EvtScript N(idle_80220790) = { EVT_LABEL(0) @@ -1228,35 +1226,35 @@ EvtScript N(handleEvent_80220908) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleKooper_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleKooper_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -1298,38 +1296,38 @@ EvtScript N(handleEvent_80220908) = { EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Idle) EVT_CASE_EQ(1) EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Toppled) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Toppled) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_ELSE - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_END_IF EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Run) EVT_SET_CONST(LVar2, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -1338,11 +1336,11 @@ EvtScript N(handleEvent_80220908) = { EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Run) EVT_CASE_EQ(1) EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(3.0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Toppled) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_AirLift) @@ -1352,16 +1350,16 @@ EvtScript N(handleEvent_80220908) = { EVT_CASE_EQ(0) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_IF_FLAG(LVar0, 0x80000) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 1, 0) EVT_ELSE EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 3, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Run) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Toppled) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_BlowAway) @@ -1590,7 +1588,7 @@ EvtScript N(nextTurn_802221A0) = { EVT_CALL(SetActorVar, ACTOR_SELF, 2, LVar0) EVT_BREAK_SWITCH EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(N(8021E118)) EVT_RETURN @@ -1713,40 +1711,40 @@ EvtScript N(handleEvent_80222468) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleBombette_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleBombette_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_SET(LVar2, 15) EVT_EXEC_WAIT(N(8021E5DC)) @@ -1756,47 +1754,47 @@ EvtScript N(handleEvent_80222468) = { EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CASE_EQ(38) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_SET(LVar2, 15) EVT_EXEC_WAIT(N(8021E5DC)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Run) EVT_SET_CONST(LVar2, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -1808,9 +1806,9 @@ EvtScript N(handleEvent_80222468) = { EVT_END }; -#define NAMESPACE b_area_mac_lee_bombette +#define NAMESPACE A(lee_bombette) #include "common/UnkActorPosFunc.inc.c" -#define NAMESPACE b_area_mac_lee +#define NAMESPACE A(lee) EvtScript N(takeTurn_802229C4) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) @@ -1944,7 +1942,7 @@ EvtScript N(nextTurn_80223298) = { EVT_CALL(SetActorVar, ACTOR_SELF, 2, LVar0) EVT_BREAK_SWITCH EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(N(8021E118)) EVT_RETURN @@ -2079,41 +2077,41 @@ EvtScript N(handleEvent_80223584) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleParakarry_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleParakarry_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E0E0)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_HurtStill) EVT_SET(LVar2, 22) EVT_EXEC_WAIT(N(8021E5DC)) @@ -2123,55 +2121,55 @@ EvtScript N(handleEvent_80223584) = { EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) EVT_CASE_EQ(38) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_HurtStill) EVT_SET(LVar2, 22) EVT_EXEC_WAIT(N(8021E5DC)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Run) EVT_SET_CONST(LVar2, ANIM_BattleParakarry_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_IF_FLAG(LVar0, 0x80000) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 1, 0) EVT_ELSE EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 3, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -2306,7 +2304,7 @@ EvtScript N(nextTurn_80224320) = { EVT_CALL(SetActorVar, ACTOR_SELF, 2, LVar0) EVT_BREAK_SWITCH EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_HurtStill) EVT_EXEC_WAIT(N(8021E118)) EVT_RETURN @@ -2441,42 +2439,42 @@ EvtScript N(handleEvent_8022460C) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_BurnHurtAlt) EVT_SET_CONST(LVar2, ANIM_BattleBow_BurnStillAlt) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_BurnHurtAlt) EVT_SET_CONST(LVar2, ANIM_BattleBow_BurnStillAlt) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E0E0)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_BurnStillAlt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_SET(LVar2, 14) EVT_EXEC_WAIT(N(8021E5DC)) @@ -2505,47 +2503,47 @@ EvtScript N(handleEvent_8022460C) = { EVT_CASE_EQ(38) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_SET(LVar2, 14) EVT_EXEC_WAIT(N(8021E5DC)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Run) EVT_SET_CONST(LVar2, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -2576,7 +2574,7 @@ EvtScript N(takeTurn_80224CA0) = { EVT_THREAD EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleBow_Run) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x80000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) EVT_CALL(AddGoalPos, ACTOR_SELF, 4, -4, 0) EVT_ELSE EVT_CALL(AddGoalPos, ACTOR_SELF, 10, -10, 0) @@ -2757,7 +2755,7 @@ EvtScript N(nextTurn_80225884) = { EVT_CALL(SetActorVar, ACTOR_SELF, 2, LVar0) EVT_BREAK_SWITCH EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(N(8021E118)) EVT_RETURN @@ -3022,74 +3020,74 @@ EvtScript N(handleEvent_80225B90) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleWatt_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleWatt_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CALL(func_80219604_465A94) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) EVT_CALL(func_80219604_465A94) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) EVT_CALL(func_80219604_465A94) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Run) EVT_SET_CONST(LVar2, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -3164,7 +3162,7 @@ EvtScript N(takeTurn_80226004) = { EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_0, BTL_CAM_MODEX_0, TRUE) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_289) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x80000) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_ADD(LVar1, 4) EVT_PLAY_EFFECT(EFFECT_RADIAL_SHIMMER, 8, LVar0, LVar1, LVar2, EVT_FLOAT(0.52), LVarA, 0) @@ -3235,7 +3233,7 @@ EvtScript N(nextTurn_80226880) = { EVT_CALL(SetActorVar, ACTOR_SELF, 2, LVar0) EVT_BREAK_SWITCH EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_CALL(func_80219604_465A94) EVT_EXEC_WAIT(N(8021E118)) @@ -3359,41 +3357,41 @@ EvtScript N(handleEvent_80226B54) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleSushie_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleSushie_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E0E0)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_SET(LVar2, 20) EVT_EXEC_WAIT(N(8021E5DC)) @@ -3403,47 +3401,47 @@ EvtScript N(handleEvent_80226B54) = { EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CASE_EQ(38) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_SET(LVar2, 20) EVT_EXEC_WAIT(N(8021E5DC)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Run) EVT_SET_CONST(LVar2, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -3710,7 +3708,7 @@ EvtScript N(nextTurn_8022831C) = { EVT_CALL(SetActorVar, ACTOR_SELF, 2, LVar0) EVT_BREAK_SWITCH EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(N(8021E118)) EVT_RETURN @@ -3850,44 +3848,44 @@ EvtScript N(handleEvent_80228614) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(8021E0E0)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleLakilester_Run) @@ -3895,46 +3893,46 @@ EvtScript N(handleEvent_80228614) = { EVT_CALL(FlyToGoal, ACTOR_SELF, 30, 0, EASING_COS_IN_OUT) EVT_CASE_EQ(38) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) EVT_EXEC_WAIT(N(8021E0E0)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Run) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -3960,7 +3958,7 @@ EvtScript N(takeTurn_80228B78) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleLakilester_Idle) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x80000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) EVT_ADD(LVar0, -1) EVT_ADD(LVar1, 4) EVT_ADD(LVar2, 2) @@ -3978,7 +3976,7 @@ EvtScript N(takeTurn_80228B78) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleLakilester_LiftSpiny) EVT_LOOP(4) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x80000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) EVT_ADDF(LVar1, EVT_FLOAT(2.4)) EVT_ELSE EVT_ADD(LVar1, 6) @@ -3988,7 +3986,7 @@ EvtScript N(takeTurn_80228B78) = { EVT_END_LOOP EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x80000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) EVT_ADD(LVar0, -3) EVT_ADD(LVar1, 16) EVT_ADD(LVar2, 2) @@ -4105,7 +4103,7 @@ EvtScript N(nextTurn_80229658) = { EVT_CALL(SetActorVar, ACTOR_SELF, 2, LVar0) EVT_BREAK_SWITCH EVT_END_IF - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(N(8021E118)) EVT_RETURN @@ -4169,13 +4167,13 @@ EvtScript N(copyPartner) = { EVT_CALL(BattleCamTargetActor, ACTOR_SELF) EVT_CALL(MoveBattleCamOver, 15) EVT_WAIT(15) - EVT_CALL(ActorSpeak, MSG_MAC_Gate_0027, ACTOR_SELF, PRT_MAIN, 0x00A40006, 0x00A40003) + EVT_CALL(ActorSpeak, MSG_MAC_Gate_0027, ACTOR_SELF, PRT_MAIN, ANIM_Lee_Talk, ANIM_Lee_Walk) EVT_WAIT(10) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20B8) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lee_RaisedArmsTalk) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x80000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) EVT_ADD(LVar1, 8) EVT_SETF(LVar3, EVT_FLOAT(0.4)) EVT_ELSE @@ -4198,21 +4196,21 @@ EvtScript N(copyPartner) = { EVT_CALL(func_80219824_465CB4, LVar5) EVT_SWITCH(LVar5) EVT_CASE_EQ(1) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_goombario)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_goombario)), FALSE) EVT_CASE_EQ(2) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_kooper)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_kooper)), FALSE) EVT_CASE_EQ(3) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bombette)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bombette)), FALSE) EVT_CASE_EQ(4) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_parakarry)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_parakarry)), FALSE) EVT_CASE_EQ(9) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bow)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bow)), FALSE) EVT_CASE_EQ(6) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_watt)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_watt)), FALSE) EVT_CASE_EQ(7) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_sushie)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_sushie)), FALSE) EVT_CASE_EQ(8) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_lakilester)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_lakilester)), FALSE) EVT_END_SWITCH EVT_SET(LVarA, LVar0) EVT_CALL(CopyStatusEffects, ACTOR_SELF, LVarA) @@ -4305,7 +4303,7 @@ EvtScript N(nextTurn_8022A038) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(12) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x3F1000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO | STATUS_FLAG_POISON | STATUS_FLAG_SHRINK) EVT_BREAK_SWITCH EVT_END_IF EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) diff --git a/src/battle/area/mac/actor/master1.c b/src/battle/area/mac/actor/master1.c index 468b6f96d9..095c680295 100644 --- a/src/battle/area/mac/actor/master1.c +++ b/src/battle/area/mac/actor/master1.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/TheMaster.h" -#define NAMESPACE b_area_mac_master1 +#define NAMESPACE A(master1) extern EvtScript N(init_8022A3B0); extern EvtScript N(takeTurn_8022AA54); @@ -125,33 +123,33 @@ EvtScript N(8022A4A4) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_BurnHurt) EVT_SET_CONST(LVar2, ANIM_TheMaster_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_BurnHurt) EVT_SET_CONST(LVar2, ANIM_TheMaster_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Defeated) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -168,46 +166,46 @@ EvtScript N(8022A4A4) = { EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Defeated) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Defeated) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Defeated) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(53) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Idle) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_Run) EVT_SET_CONST(LVar2, ANIM_TheMaster_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -323,7 +321,7 @@ EvtScript N(nextTurn_8022B06C) = { EVT_END_IF EVT_CASE_EQ(12) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x351000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO) EVT_BREAK_SWITCH EVT_END_IF EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) @@ -352,7 +350,7 @@ EvtScript N(nextTurn_8022B06C) = { EvtScript N(handleEvent_8022B2CC) = { EVT_EXEC_WAIT(N(8022A4A4)) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x351000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO) EVT_RETURN EVT_END_IF EVT_CALL(GetBattleFlags, LVar0) @@ -374,7 +372,7 @@ EvtScript N(handleEvent_8022B2CC) = { EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVarB) EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x3F1000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO | STATUS_FLAG_POISON | STATUS_FLAG_SHRINK) EVT_BREAK_SWITCH EVT_END_IF EVT_SET(LFlag0, FALSE) diff --git a/src/battle/area/mac/actor/master2.c b/src/battle/area/mac/actor/master2.c index 2bb47b672e..72fd9c993b 100644 --- a/src/battle/area/mac/actor/master2.c +++ b/src/battle/area/mac/actor/master2.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/TheMaster.h" -#define NAMESPACE b_area_mac_master2 +#define NAMESPACE A(master2) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -546,7 +544,7 @@ EvtScript N(nextTurn_8022CFFC) = { EVT_END_IF EVT_CASE_EQ(12) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x351000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO) EVT_BREAK_SWITCH EVT_END_IF EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) @@ -575,7 +573,7 @@ EvtScript N(nextTurn_8022CFFC) = { EvtScript N(handleEvent_8022D634) = { EVT_EXEC_WAIT(N(8022B8C0)) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x351000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO) EVT_RETURN EVT_END_IF EVT_CALL(GetBattleFlags, LVar0) @@ -597,7 +595,7 @@ EvtScript N(handleEvent_8022D634) = { EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVarB) EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x3F1000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO | STATUS_FLAG_POISON | STATUS_FLAG_SHRINK) EVT_BREAK_SWITCH EVT_END_IF EVT_SET(LFlag0, FALSE) diff --git a/src/battle/area/mac/actor/master3.c b/src/battle/area/mac/actor/master3.c index e609a9b94f..38337dc294 100644 --- a/src/battle/area/mac/actor/master3.c +++ b/src/battle/area/mac/actor/master3.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/TheMaster.h" -#define NAMESPACE b_area_mac_master3 +#define NAMESPACE A(master3) extern EvtScript N(init_8022DB60); extern EvtScript N(takeTurn_80230B20); @@ -148,13 +146,13 @@ EvtScript N(8022DC44) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedHurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_BurnHurt) EVT_SET_CONST(LVar2, ANIM_TheMaster_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -163,16 +161,16 @@ EvtScript N(8022DC44) = { EVT_CALL(ModifyActorDecoration, ACTOR_SELF, PRT_MAIN, 0, 50, 50, 0, 0) EVT_CASE_EQ(36) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_BurnHurt) EVT_SET_CONST(LVar2, ANIM_TheMaster_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedDefeated) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedHurt) EVT_CHILD_THREAD EVT_WAIT(30) @@ -184,10 +182,10 @@ EvtScript N(8022DC44) = { EVT_END_CHILD_THREAD EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedHurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedHurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -204,46 +202,46 @@ EvtScript N(8022DC44) = { EVT_CASE_OR_EQ(23) EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedIdle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedHurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedDefeated) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedHurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedDefeated) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedHurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedDefeated) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(53) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedIdle) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedIdle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TheMaster_AscendedRun) EVT_SET_CONST(LVar2, ANIM_TheMaster_AscendedHurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -930,7 +928,7 @@ EvtScript N(nextTurn_80230D44) = { EVT_END_IF EVT_CASE_EQ(12) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x351000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO) EVT_BREAK_SWITCH EVT_END_IF EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) @@ -959,7 +957,7 @@ EvtScript N(nextTurn_80230D44) = { EvtScript N(handleEvent_80231408) = { EVT_EXEC_WAIT(N(8022DC44)) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x351000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO) EVT_RETURN EVT_END_IF EVT_CALL(GetBattleFlags, LVar0) @@ -981,7 +979,7 @@ EvtScript N(handleEvent_80231408) = { EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVarB) EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, 0x3F1000) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_DOJO | STATUS_FLAG_POISON | STATUS_FLAG_SHRINK) EVT_BREAK_SWITCH EVT_END_IF EVT_SET(LFlag0, FALSE) diff --git a/src/battle/area/mac/area.c b/src/battle/area/mac/area.c index 1be0e5012b..63d42a4531 100644 --- a/src/battle/area/mac/area.c +++ b/src/battle/area/mac/area.c @@ -1,49 +1,45 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "area.h" -#define NAMESPACE b_area_mac +extern ActorBlueprint A(chan); +extern ActorBlueprint A(lee); +extern ActorBlueprint A(master1); +extern ActorBlueprint A(master2); +extern ActorBlueprint A(master3); -extern ActorBlueprint N(chan); -extern ActorBlueprint N(lee); -extern ActorBlueprint N(master1); -extern ActorBlueprint N(master2); -extern ActorBlueprint N(master3); +extern Stage A(mac_01); +extern Stage A(mac_02); -extern Stage N(mac_01); -extern Stage N(mac_02); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(chan), BTL_POS_GROUND_C, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(chan), BTL_POS_GROUND_C, 10), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(lee), BTL_POS_GROUND_C, 10), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(lee), BTL_POS_GROUND_C, 10), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(master1), BTL_POS_GROUND_C, 10), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(master1), BTL_POS_GROUND_C, 10), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(master2), BTL_POS_GROUND_C, 10), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(master2), BTL_POS_GROUND_C, 10), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(master3), BTL_POS_GROUND_C, 10), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(master3), BTL_POS_GROUND_C, 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(mac_02), "チェン"), - BATTLE(N(Formation_01), N(mac_02), "リー"), - BATTLE(N(Formation_02), N(mac_02), "シショー その1"), - BATTLE(N(Formation_03), N(mac_02), "シショー その2"), - BATTLE(N(Formation_04), N(mac_02), "シショー その3"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(mac_02), "チェン"), + BATTLE(A(Formation_01), A(mac_02), "リー"), + BATTLE(A(Formation_02), A(mac_02), "シショー その1"), + BATTLE(A(Formation_03), A(mac_02), "シショー その2"), + BATTLE(A(Formation_04), A(mac_02), "シショー その3"), {}, }; -StageList N(Stages) = { - STAGE("mac_01", N(mac_01)), - STAGE("mac_02", N(mac_02)), +StageList A(Stages) = { + STAGE("mac_01", A(mac_01)), + STAGE("mac_02", A(mac_02)), {}, }; diff --git a/src/battle/area/mac/area.h b/src/battle/area/mac/area.h new file mode 100644 index 0000000000..b2b2fad48b --- /dev/null +++ b/src/battle/area/mac/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_mac diff --git a/src/battle/area/mac/stage/mac_01.c b/src/battle/area/mac/stage/mac_01.c index e821aa8452..dc8f11321e 100644 --- a/src/battle/area/mac/stage/mac_01.c +++ b/src/battle/area/mac/stage/mac_01.c @@ -1,43 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/mac_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_mac_mac_01 - -#include "battle/common/stage/lib/WaterEffects.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SET(LVar0, MODEL_nami4) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_nami3) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_nami2) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_nami1) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_END_THREAD - EVT_SET(LVar0, MODEL_o391) - EVT_EXEC(N(EVS_AnimateFishModel)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "mac_tex", - .shape = "mac_bt01_shape", - .hit = "mac_bt01_hit", - .bg = "nok_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_mac/mac_01.inc.c" diff --git a/src/battle/area/mac/stage/mac_02.c b/src/battle/area/mac/stage/mac_02.c index 049cac0ed0..40ca7103a9 100644 --- a/src/battle/area/mac/stage/mac_02.c +++ b/src/battle/area/mac/stage/mac_02.c @@ -1,28 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/mac_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_mac_mac_02 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(EnableBattleFloorReflections, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_CALL(EnableBattleFloorReflections, FALSE) - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "mac_tex", - .shape = "mac_bt02_shape", - .hit = "mac_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_mac/mac_02.inc.c" diff --git a/src/battle/area/mim/actor/bzzap.c b/src/battle/area/mim/actor/bzzap.c index e33fe82157..7b0cc78685 100644 --- a/src/battle/area/mim/actor/bzzap.c +++ b/src/battle/area/mim/actor/bzzap.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_mim_bzzap +#include "../area.h" #include "battle/common/actor/bzzap.inc.c" diff --git a/src/battle/area/mim/actor/forest_fuzzy.c b/src/battle/area/mim/actor/forest_fuzzy.c index 7279a834d9..7613266319 100644 --- a/src/battle/area/mim/actor/forest_fuzzy.c +++ b/src/battle/area/mim/actor/forest_fuzzy.c @@ -1,665 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Fuzzy.h" +#include "../area.h" -#define NAMESPACE b_area_mim_forest_fuzzy - -extern s32 N(IdleAnimations_802184C4)[]; -extern EvtScript N(init_80218510); -extern EvtScript N(takeTurn_8021A61C); -extern EvtScript N(idle_80218574); -extern EvtScript N(handleEvent_80218584); -extern Formation N(specialFormation_8021A800); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable_802183C0)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_802183CC)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 95, - STATUS_KEY_POISON, 90, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 70, - STATUS_KEY_PARALYZE, 75, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 20 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_802184C4), - .defenseTable = N(DefenseTable_802183C0), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_FOREST_FUZZY, - .level = 11, - .maxHP = 6, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_80218510), - .statusTable = N(StatusTable_802183CC), - .escapeChance = 40, - .airLiftChance = 90, - .hurricaneChance = 90, - .spookChance = 85, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 33, 28 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_802184C4)[] = { - STATUS_KEY_NORMAL, ANIM_Fuzzy_Forest_Idle, - STATUS_KEY_STONE, ANIM_Fuzzy_Forest_Still, - STATUS_KEY_SLEEP, ANIM_Fuzzy_Forest_Sleep, - STATUS_KEY_POISON, ANIM_Fuzzy_Forest_Idle, - STATUS_KEY_STOP, ANIM_Fuzzy_Forest_Still, - STATUS_KEY_STATIC, ANIM_Fuzzy_Forest_Idle, - STATUS_KEY_PARALYZE, ANIM_Fuzzy_Forest_Still, - STATUS_KEY_DIZZY, ANIM_Fuzzy_Forest_Stunned, - STATUS_KEY_FEAR, ANIM_Fuzzy_Forest_Stunned, - STATUS_END, -}; - -EvtScript N(init_80218510) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021A61C))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80218574))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80218584))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_80218574) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80218584) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_CALL(GetLastElement, LVar0) - EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Burn) - EVT_SET_CONST(LVar2, ANIM_Fuzzy_Forest_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Burn) - EVT_SET_CONST(LVar2, ANIM_Fuzzy_Forest_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Run) - EVT_EXEC_WAIT(EVS_Enemy_HopHome) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_CALL(GetLastElement, LVar0) - EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Run) - EVT_SET_CONST(LVar2, ANIM_Fuzzy_Forest_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Run) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80218C48) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) - EVT_CALL(SetBattleCamZoom, 330) - EVT_CALL(SetBattleCamOffsetZ, 30) - EVT_CALL(MoveBattleCamOver, 20) - EVT_WAIT(20) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) - EVT_THREAD - EVT_WAIT(30) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206E) - EVT_WAIT(30) - EVT_LOOP(4) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206F) - EVT_WAIT(11) - EVT_END_LOOP - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2070) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Anim0D) - EVT_WAIT(130) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Walk) - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8021A800)), 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(SetActorPos, LVar0, LVar1, LVar2, LVar3) - EVT_CALL(SetGoalToIndex, LVar0, LVarA) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 20) - EVT_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Walk) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(JumpToGoal, ACTOR_SELF, 14, FALSE, TRUE, FALSE) - EVT_END_THREAD - EVT_WAIT(1) - EVT_CALL(SetAnimation, LVar0, 1, ANIM_Fuzzy_Forest_Walk) - EVT_CALL(SetActorJumpGravity, LVar0, EVT_FLOAT(1.4)) - EVT_CALL(JumpToGoal, LVar0, 14, FALSE, TRUE, FALSE) - EVT_CALL(GetActorPos, LVar0, LVar1, LVar2, LVar3) - EVT_CALL(ForceHomePos, LVar0, LVar1, LVar2, LVar3) - EVT_CALL(HPBarToHome, LVar0) - EVT_CALL(SetAnimation, LVar0, 1, ANIM_Fuzzy_Forest_Idle) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar1) - EVT_SWITCH(LVar1) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, LVar0, 0, 1) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, LVar0, 0, 2) - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/SpawnEnemyDrainFX.inc.c" - -EvtScript N(80219054) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_GOTO(100) - EVT_END_IF - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Idle) - EVT_LABEL(100) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Anim04) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 9, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) - EVT_WAIT(5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_SET(LVar1, 0) - EVT_SUB(LVar2, 5) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Jump) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 11, FALSE, TRUE, FALSE) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Anim09) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 15) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_WAIT(4) - EVT_WAIT(5) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(5) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_EQ(HIT_RESULT_HIT_STATIC) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_STATIC) - EVT_SET(LFlag0, FALSE) - EVT_ELSE - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, -3, -12, -15) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Jump) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 0, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_RETURN - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE) - EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Leeching) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Bite) - EVT_WAIT(21) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Still) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, -3, -2, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.9), EVT_FLOAT(1.2), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.8), EVT_FLOAT(1.3), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) - EVT_WAIT(2) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.6), EVT_FLOAT(1.6), EVT_FLOAT(1.0)) - EVT_WAIT(10) - EVT_WAIT(2) - EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Idle) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar3) - EVT_IF_NE(LVar3, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_214) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 10) - EVT_CALL(N(SpawnDrainHealthStartFX), LVar0, LVar1, LVar2, LVar3) - EVT_THREAD - EVT_WAIT(15) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_25C) - EVT_CALL(N(SpawnDrainHealthContinueFX), LVar0, LVar1, LVar2, LVar3) - EVT_END_THREAD - EVT_ADD(LVar0, 20) - EVT_ADD(LVar1, 20) - EVT_PLAY_EFFECT(EFFECT_RECOVER, 0, LVar0, LVar1, LVar2, LVar3, 0) - EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) - EVT_ADD(LVar0, LVar3) - EVT_CALL(SetEnemyHP, ACTOR_SELF, LVar0) - EVT_END_IF - EVT_THREAD - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.6), EVT_FLOAT(0.6), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 300) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 270) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(0.7), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 240) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 210) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 180) - EVT_WAIT(2) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(0.7), EVT_FLOAT(1.0)) - EVT_WAIT(2) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.2), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_END_THREAD - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.4), EVT_FLOAT(0.2), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.2), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 150) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 120) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 90) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 60) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 30) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Idle) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021A0D4) = { - EVT_SET(LFlag1, FALSE) - EVT_SET(LFlag2, FALSE) - EVT_SET(LFlag3, FALSE) - EVT_SET(LFlag4, FALSE) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar5) - EVT_CALL(GetIndexFromHome, LVar0, LVar5) - EVT_MOD(LVar5, 4) - EVT_SWITCH(LVar5) - EVT_CASE_EQ(0) - EVT_SET(LFlag1, TRUE) - EVT_CASE_EQ(1) - EVT_SET(LFlag2, TRUE) - EVT_CASE_EQ(2) - EVT_SET(LFlag3, TRUE) - EVT_CASE_EQ(3) - EVT_SET(LFlag4, TRUE) - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_SET(LVarA, -1) - EVT_SET(LVarB, -1) - EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_IF_EQ(LFlag2, FALSE) - EVT_SET(LVarA, 1) - EVT_END_IF - EVT_CASE_EQ(1) - EVT_IF_EQ(LFlag1, FALSE) - EVT_SET(LVarA, 0) - EVT_END_IF - EVT_IF_EQ(LFlag3, FALSE) - EVT_IF_EQ(LVarA, -1) - EVT_SET(LVarA, 2) - EVT_ELSE - EVT_SET(LVarB, 2) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(2) - EVT_IF_EQ(LFlag2, FALSE) - EVT_SET(LVarA, 1) - EVT_END_IF - EVT_IF_EQ(LFlag4, FALSE) - EVT_IF_EQ(LVarA, -1) - EVT_SET(LVarA, 3) - EVT_ELSE - EVT_SET(LVarB, 3) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(3) - EVT_IF_EQ(LFlag3, FALSE) - EVT_SET(LVarA, 2) - EVT_END_IF - EVT_END_SWITCH - EVT_IF_NE(LVarB, -1) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 500) - EVT_SET(LVarA, LVarB) - EVT_END_IF - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(8021A45C) = { - EVT_SET(LVar9, 0) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetOriginalActorType, LVar0, LVar2) - EVT_SWITCH(LVar2) - EVT_CASE_OR_EQ(ACTOR_TYPE_FOREST_FUZZY) - EVT_CASE_OR_EQ(ACTOR_TYPE_JUNGLE_FUZZY) - EVT_CALL(GetStatusFlags, LVar0, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(GetActorVar, LVar0, 0, LVar3) - EVT_IF_NE(LVar3, 2) - EVT_ADD(LVar9, 1) - EVT_END_IF - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(ACTOR_TYPE_SPEAR_GUY) - EVT_CALL(GetStatusFlags, LVar0, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(GetActorVar, LVar0, 1, LVar3) - EVT_IF_LT(LVar3, 2) - EVT_ADD(LVar9, 1) - EVT_END_IF - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021A61C) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_EXEC_WAIT(N(80219054)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 2) - EVT_EXEC_WAIT(N(80219054)) - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(8021A0D4)) - EVT_IF_EQ(LVarA, -1) - EVT_EXEC_WAIT(N(80219054)) - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(8021A45C)) - EVT_SWITCH(LVar9) - EVT_CASE_EQ(1) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 300) - EVT_EXEC_WAIT(N(80218C48)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(2) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 150) - EVT_EXEC_WAIT(N(80218C48)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(3) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 100) - EVT_EXEC_WAIT(N(80218C48)) - EVT_RETURN - EVT_END_IF - EVT_END_SWITCH - EVT_EXEC_WAIT(N(80219054)) - EVT_RETURN - EVT_END -}; - -Vec3i N(vector3D_8021A7F4) = { NPC_DISPOSE_LOCATION }; - -Formation N(specialFormation_8021A800) = { - ACTOR_BY_POS(NAMESPACE, N(vector3D_8021A7F4), 0), -}; +#include "battle/common/actor/forest_fuzzy.inc.c" diff --git a/src/battle/area/mim/actor/piranha_plant.c b/src/battle/area/mim/actor/piranha_plant.c index 77a9275f6f..c305028aa2 100644 --- a/src/battle/area/mim/actor/piranha_plant.c +++ b/src/battle/area/mim/actor/piranha_plant.c @@ -1,375 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/SmallPiranha.h" +#include "../area.h" -#define NAMESPACE b_area_mim_piranha_plant - -extern EvtScript N(init_8021D498); -extern EvtScript N(takeTurn_8021DCD4); -extern EvtScript N(idle_8021D4E4); -extern EvtScript N(handleEvent_8021D60C); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(IdleAnimations_8021D330)[] = { - STATUS_KEY_NORMAL, ANIM_SmallPiranha_Anim01, - STATUS_KEY_STONE, ANIM_SmallPiranha_Anim00, - STATUS_KEY_SLEEP, ANIM_SmallPiranha_Anim00, - STATUS_KEY_POISON, ANIM_SmallPiranha_Anim01, - STATUS_KEY_STOP, ANIM_SmallPiranha_Anim00, - STATUS_KEY_STATIC, ANIM_SmallPiranha_Anim01, - STATUS_KEY_PARALYZE, ANIM_SmallPiranha_Anim00, - STATUS_KEY_DIZZY, ANIM_SmallPiranha_Anim01, - STATUS_KEY_FEAR, ANIM_SmallPiranha_Anim01, - STATUS_END, -}; - -s32 N(unk_missing_8021D37C)[] = { - STATUS_KEY_NORMAL, ANIM_SmallPiranha_Anim01, - STATUS_END, -}; - -s32 N(unk_missing_8021D388)[] = { - STATUS_KEY_NORMAL, ANIM_SmallPiranha_Anim06, - STATUS_END, -}; - -s32 N(DefenseTable_8021D394)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8021D3A0)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 95, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 100, - STATUS_KEY_SHRINK, 80, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 35 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021D330), - .defenseTable = N(DefenseTable_8021D394), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_PIRANHA_PLANT, - .level = 11, - .maxHP = 5, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021D498), - .statusTable = N(StatusTable_8021D3A0), - .escapeChance = 70, - .airLiftChance = 20, - .hurricaneChance = 20, - .spookChance = 40, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 90, - .coinReward = 1, - .size = { 38, 38 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -7, 33 }, - .statusTextOffset = { 10, 33 }, -}; - -EvtScript N(init_8021D498) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021DCD4))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021D4E4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021D60C))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_8021D4E4) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(8021D4F4) = { - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim04) - EVT_WAIT(10) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim03) - EVT_WAIT(10) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021D60C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim0A) - EVT_SET_CONST(LVar2, ANIM_SmallPiranha_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim0A) - EVT_SET_CONST(LVar2, ANIM_SmallPiranha_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8021D4F4)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_SPIKE_TAUNT) - EVT_THREAD - EVT_WAIT(10) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, 0) - EVT_ADD(LVar1, 14) - EVT_ELSE - EVT_ADD(LVar0, 0) - EVT_ADD(LVar1, 35) - EVT_END_IF - EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) - EVT_WAIT(20) - EVT_END_THREAD - EVT_LOOP(40) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim01) - EVT_WAIT(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim06) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim01) - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim04) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_WAIT(8) - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(RemoveActor, ACTOR_SELF) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021DCD4) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim04) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 1) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_WAIT(15) - EVT_GOTO(123) - EVT_END_IF - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim04) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_WAIT(8) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) - EVT_CALL(SetBattleCamZoom, 350) - EVT_CALL(SetBattleCamOffsetZ, 45) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) - EVT_IF_FLAG(LVar5, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, 8) - EVT_ADD(LVar0, -3) - EVT_ELSE - EVT_ADD(LVar0, 20) - EVT_END_IF - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, FALSE, FALSE) - EVT_LABEL(123) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim03) - EVT_WAIT(8) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim05) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) - EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim06) - EVT_WAIT(2) - EVT_END_IF - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DE) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim07) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim08) - EVT_WAIT(2) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8021D4F4)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim06) - EVT_WAIT(2) - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DE) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim07) - EVT_WAIT(10) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_WAIT(2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim08) - EVT_WAIT(15) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(8021D4F4)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/piranha_plant.inc.c" diff --git a/src/battle/area/mim/area.c b/src/battle/area/mim/area.c index f2c31da412..e65e6b8340 100644 --- a/src/battle/area/mim/area.c +++ b/src/battle/area/mim/area.c @@ -1,144 +1,140 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "area.h" -#define NAMESPACE b_area_mim +extern ActorBlueprint A(forest_fuzzy); +extern ActorBlueprint A(piranha_plant); +extern ActorBlueprint A(bzzap); -extern ActorBlueprint N(forest_fuzzy); -extern ActorBlueprint N(piranha_plant); -extern ActorBlueprint N(bzzap); +extern Stage A(mim_01); -extern Stage N(mim_01); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_C, 8), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_D, 7), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_C, 9), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_C, 8), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_D, 7), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_D, 7), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_D, 7), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_B, 10), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_C, 9), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_C, 8), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_D, 7), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_C, 9), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_C, 8), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_C, 8), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(forest_fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(piranha_plant), BTL_POS_GROUND_C, 8), +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(forest_fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(piranha_plant), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 9), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 9), }; -Formation N(Formation_11) = { - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(bzzap), BTL_POS_AIR_C, 8), +Formation A(Formation_11) = { + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(bzzap), BTL_POS_AIR_C, 8), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(mim_01), "グリーンチョロボンx2"), - BATTLE(N(Formation_01), N(mim_01), "グリーンチョロボンx3"), - BATTLE(N(Formation_02), N(mim_01), "グリーンチョロボンx4"), - BATTLE(N(Formation_03), N(mim_01), "グリーンチョロボン,パックンフラワー"), - BATTLE(N(Formation_04), N(mim_01), "グリーンチョロボンx2,パックンフラワー"), - BATTLE(N(Formation_05), N(mim_01), "グリーンチョロボンx2,パックンフラワーx2"), - BATTLE(N(Formation_06), N(mim_01), "グリーンチョロボンx3,パックンフラワー"), - BATTLE(N(Formation_07), N(mim_01), "グリーンチョロボン,パックンフラワー,グリーンチョロボン,パックンフラワー"), - BATTLE(N(Formation_08), N(mim_01), "パックンフラワー"), - BATTLE(N(Formation_09), N(mim_01), "パックンフラワーx2"), - BATTLE(N(Formation_0A), N(mim_01), "パックンフラワーx3"), - BATTLE(N(Formation_0B), N(mim_01), "パックンフラワーx4"), - BATTLE(N(Formation_0C), N(mim_01), "パックンフラワー,グリーンチョロボン"), - BATTLE(N(Formation_0D), N(mim_01), "パックンフラワーx2,グリーンチョロボン"), - BATTLE(N(Formation_0E), N(mim_01), "パックンフラワー,グリーンチョロボンx2"), - BATTLE(N(Formation_0F), N(mim_01), "パックンフラワー,グリーンチョロボン,パックンフラワー"), - BATTLE(N(Formation_10), N(mim_01), "ハッチーx2"), - BATTLE(N(Formation_11), N(mim_01), "ハッチーx3"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(mim_01), "グリーンチョロボンx2"), + BATTLE(A(Formation_01), A(mim_01), "グリーンチョロボンx3"), + BATTLE(A(Formation_02), A(mim_01), "グリーンチョロボンx4"), + BATTLE(A(Formation_03), A(mim_01), "グリーンチョロボン,パックンフラワー"), + BATTLE(A(Formation_04), A(mim_01), "グリーンチョロボンx2,パックンフラワー"), + BATTLE(A(Formation_05), A(mim_01), "グリーンチョロボンx2,パックンフラワーx2"), + BATTLE(A(Formation_06), A(mim_01), "グリーンチョロボンx3,パックンフラワー"), + BATTLE(A(Formation_07), A(mim_01), "グリーンチョロボン,パックンフラワー,グリーンチョロボン,パックンフラワー"), + BATTLE(A(Formation_08), A(mim_01), "パックンフラワー"), + BATTLE(A(Formation_09), A(mim_01), "パックンフラワーx2"), + BATTLE(A(Formation_0A), A(mim_01), "パックンフラワーx3"), + BATTLE(A(Formation_0B), A(mim_01), "パックンフラワーx4"), + BATTLE(A(Formation_0C), A(mim_01), "パックンフラワー,グリーンチョロボン"), + BATTLE(A(Formation_0D), A(mim_01), "パックンフラワーx2,グリーンチョロボン"), + BATTLE(A(Formation_0E), A(mim_01), "パックンフラワー,グリーンチョロボンx2"), + BATTLE(A(Formation_0F), A(mim_01), "パックンフラワー,グリーンチョロボン,パックンフラワー"), + BATTLE(A(Formation_10), A(mim_01), "ハッチーx2"), + BATTLE(A(Formation_11), A(mim_01), "ハッチーx3"), {}, }; -StageList N(Stages) = { - STAGE("mim_01", N(mim_01)), +StageList A(Stages) = { + STAGE("mim_01", A(mim_01)), {}, }; diff --git a/src/battle/area/mim/area.h b/src/battle/area/mim/area.h new file mode 100644 index 0000000000..6c8eededd4 --- /dev/null +++ b/src/battle/area/mim/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_mim diff --git a/src/battle/area/mim/stage/mim_01.c b/src/battle/area/mim/stage/mim_01.c index ddbda9569d..b8dc9f7667 100644 --- a/src/battle/area/mim/stage/mim_01.c +++ b/src/battle/area/mim/stage/mim_01.c @@ -1,27 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/mim_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_mim_mim_01 - -#include "common/UnkFogFunc2.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(N(UnkFogFunc2)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "mim_tex", - .shape = "mim_bt01_shape", - .hit = "mim_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_mim/mim_01.inc.c" diff --git a/src/battle/area/nok/actor/fuzzy.c b/src/battle/area/nok/actor/fuzzy.c index 5936ee4e7c..af27120fee 100644 --- a/src/battle/area/nok/actor/fuzzy.c +++ b/src/battle/area/nok/actor/fuzzy.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_nok_fuzzy +#include "../area.h" #include "battle/common/actor/fuzzy.inc.c" diff --git a/src/battle/area/nok/actor/goomba.c b/src/battle/area/nok/actor/goomba.c index f1b1dcf664..7827ad425b 100644 --- a/src/battle/area/nok/actor/goomba.c +++ b/src/battle/area/nok/actor/goomba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_nok_goomba +#include "../area.h" #include "battle/common/actor/goomba.inc.c" diff --git a/src/battle/area/nok/actor/kent_c_koopa.c b/src/battle/area/nok/actor/kent_c_koopa.c index 9b8958bfee..2985757428 100644 --- a/src/battle/area/nok/actor/kent_c_koopa.c +++ b/src/battle/area/nok/actor/kent_c_koopa.c @@ -1,26 +1,54 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Coin.h" +#include "../area.h" #include "sprite/npc/KentCKoopa.h" +#include "sprite/npc/Coin.h" -#define NAMESPACE b_area_nok_kent_c_koopa +#define NAMESPACE A(kent_c_koopa) + +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_HandlePhase); + +extern EvtScript N(EVS_KentC_GoHome); +extern EvtScript N(EVS_Flipped_SpinSmashHit); +extern EvtScript N(EVS_Flipped_SpinSmashDeath); +extern EvtScript N(EVS_FlipOver); +extern EvtScript N(EVS_Attack_ShellToss); +extern EvtScript N(EVS_Attack_HeavyStomp); + +extern EvtScript N(EVS_DropDummyCoins); +extern EvtScript N(EVS_DropDummyCoin); enum N(ActorPartIDs) { PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, - PRT_5 = 5, - PRT_6 = 6, - PRT_7 = 7, - PRT_8 = 8, - PRT_9 = 9, + PRT_FLIPPED = 2, // targetable body while flipped + PRT_WEAK_POINT = 3, // the tail + PRT_DUMMY_COIN_1 = 4, + PRT_DUMMY_COIN_2 = 5, + PRT_DUMMY_COIN_3 = 6, + PRT_DUMMY_COIN_4 = 7, + PRT_DUMMY_COIN_5 = 8, + PRT_DUMMY_COIN_6 = 9, +}; + +enum N(ActorVars) { + AVAR_IsFlipped = 0, + AVAR_Anim_Hurt = 1, + AVAR_FlippedTurns = 2, // turns left to remain flipped + AVAR_CoinsToDrop = 3, // remaining coins that can drop via Spin Smashing while flipped over + AVAR_FlipResistance = 4, // number of hits before flipping over +}; + +enum N(ActorParams) { + DMG_SHELL_TOSS_PLAYER = 3, + DMG_SHELL_TOSS_PARTNER = 3, + DMG_HEAVY_STOMP = 10, }; s32 N(FlipPosOffsets)[] = { 9, 16, 22, 26, 30, 32, 33, 32, 30, 26, 22, 16, 9, 0, 4, 6, 7, 6, 4, 0, 2, 0 }; -s32 N(IdleAnimations_80227968)[] = { +s32 N(DefaultAnims)[] = { STATUS_KEY_NORMAL, ANIM_KentCKoopa_Anim01, STATUS_KEY_STONE, ANIM_KentCKoopa_Anim00, STATUS_KEY_SLEEP, ANIM_KentCKoopa_Anim13, @@ -33,35 +61,35 @@ s32 N(IdleAnimations_80227968)[] = { STATUS_END, }; -s32 N(IdleAnimations_802279B4)[] = { +s32 N(FlippedAnims)[] = { STATUS_KEY_NORMAL, ANIM_KentCKoopa_Anim1A, STATUS_KEY_STOP, ANIM_KentCKoopa_Anim19, STATUS_KEY_PARALYZE, ANIM_KentCKoopa_Anim19, STATUS_END, }; -s32 N(IdleAnimations_802279D0)[] = { +s32 N(CoinAnims)[] = { STATUS_KEY_NORMAL, ANIM_Coin_Rotate, STATUS_END, }; -s32 N(DefenseTable_802279DC)[] = { +s32 N(NormalDefense)[] = { ELEMENT_NORMAL, 6, ELEMENT_BLAST, 6, ELEMENT_END, }; -s32 N(DefenseTable_802279F0)[] = { +s32 N(FlippedDefense)[] = { ELEMENT_NORMAL, 3, ELEMENT_END, }; -s32 N(DefenseTable_802279FC)[] = { +s32 N(FlippedTailDefense)[] = { ELEMENT_NORMAL, 0, ELEMENT_END, }; -s32 N(StatusTable_80227A08)[] = { +s32 N(StatusTable)[] = { STATUS_KEY_NORMAL, 0, STATUS_KEY_DEFAULT, 0, STATUS_KEY_SLEEP, 80, @@ -86,128 +114,126 @@ s32 N(StatusTable_80227A08)[] = { STATUS_END, }; -ActorPartBlueprint N(ActorParts_80227AB4)[] = { +ActorPartBlueprint N(ActorParts)[] = { { .flags = ACTOR_PART_FLAG_MULTI_TARGET, .index = PRT_MAIN, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 60 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_80227968), - .defenseTable = N(DefenseTable_802279DC), + .idleAnimations = N(DefaultAnims), + .defenseTable = N(NormalDefense), .eventFlags = ACTOR_EVENT_FLAG_FLIPABLE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, 0 }, }, { .flags = ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_2, + .index = PRT_FLIPPED, .posOffset = { 12, 61, 0 }, .targetOffset = { 0, -20 }, .opacity = 255, .idleAnimations = NULL, - .defenseTable = N(DefenseTable_802279F0), + .defenseTable = N(FlippedDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, 0 }, }, { .flags = ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_3, + .index = PRT_WEAK_POINT, .posOffset = { 45, 0, 0 }, .targetOffset = { -70, 26 }, .opacity = 255, .idleAnimations = NULL, - .defenseTable = N(DefenseTable_802279FC), + .defenseTable = N(FlippedTailDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, 0 }, }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_4, + .index = PRT_DUMMY_COIN_1, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_802279D0), - .defenseTable = N(DefenseTable_802279FC), + .idleAnimations = N(CoinAnims), + .defenseTable = N(FlippedTailDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, 0 }, }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_5, + .index = PRT_DUMMY_COIN_2, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_802279D0), - .defenseTable = N(DefenseTable_802279FC), + .idleAnimations = N(CoinAnims), + .defenseTable = N(FlippedTailDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, 0 }, }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_6, + .index = PRT_DUMMY_COIN_3, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_802279D0), - .defenseTable = N(DefenseTable_802279FC), + .idleAnimations = N(CoinAnims), + .defenseTable = N(FlippedTailDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, 0 }, }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_7, + .index = PRT_DUMMY_COIN_4, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_802279D0), - .defenseTable = N(DefenseTable_802279FC), + .idleAnimations = N(CoinAnims), + .defenseTable = N(FlippedTailDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, 0 }, }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_8, + .index = PRT_DUMMY_COIN_5, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_802279D0), - .defenseTable = N(DefenseTable_802279FC), + .idleAnimations = N(CoinAnims), + .defenseTable = N(FlippedTailDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, 0 }, }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_9, + .index = PRT_DUMMY_COIN_6, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_802279D0), - .defenseTable = N(DefenseTable_802279FC), + .idleAnimations = N(CoinAnims), + .defenseTable = N(FlippedTailDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, 0 }, }, }; -extern EvtScript N(init_80227C20); - ActorBlueprint NAMESPACE = { .flags = 0, .type = ACTOR_TYPE_KENT_C_KOOPA, .level = 55, .maxHP = 70, - .partCount = ARRAY_COUNT( N(ActorParts_80227AB4)), - .partsData = N(ActorParts_80227AB4), - .initScript = &N(init_80227C20), - .statusTable = N(StatusTable_80227A08), + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), .escapeChance = 0, .airLiftChance = 0, .hurricaneChance = 0, @@ -222,34 +248,29 @@ ActorBlueprint NAMESPACE = { .statusTextOffset = { 2, 63 }, }; -extern EvtScript N(takeTurn_80228A7C); -extern EvtScript N(idle_80227DD4); -extern EvtScript N(handleEvent_80227E08); -extern EvtScript N(nextTurn_80227D2C); - -EvtScript N(init_80227C20) = { +EvtScript N(EVS_Init) = { EVT_CALL(func_8027D434, ACTOR_SELF, 3, 70) - EVT_CALL(SetPartSize, ACTOR_SELF, PRT_3, 30, 30) - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80228A7C))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80227DD4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80227E08))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_80227D2C))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x0047001C) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 20) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 2) + EVT_CALL(SetPartSize, ACTOR_SELF, PRT_WEAK_POINT, 30, 30) + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(EVS_HandlePhase))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_IsFlipped, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, ANIM_KentCKoopa_Anim1C) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlippedTurns, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_CoinsToDrop, 20) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 2) EVT_RETURN EVT_END }; -EvtScript N(nextTurn_80227D2C) = { +EvtScript N(EVS_HandlePhase) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(GetBattlePhase, LVar0) EVT_SWITCH(LVar0) - EVT_CASE_EQ(10) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 2) + EVT_CASE_EQ(PHASE_PLAYER_BEGIN) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 2) EVT_END_SWITCH EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) @@ -257,49 +278,42 @@ EvtScript N(nextTurn_80227D2C) = { EVT_END }; -EvtScript N(idle_80227DD4) = { +EvtScript N(EVS_Idle) = { EVT_LABEL(0) - EVT_WAIT(1) - EVT_GOTO(0) + EVT_WAIT(1) + EVT_GOTO(0) EVT_RETURN EVT_END }; -extern EvtScript N(8022AD84); -extern EvtScript N(8022B158); -extern EvtScript N(8022B204); -extern EvtScript N(flipOver_KentC); -extern EvtScript N(shellToss_KentC); -extern EvtScript N(tackle_KentC); - -EvtScript N(handleEvent_80227E08) = { +EvtScript N(EVS_HandleEvent) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(GetLastElement, LVarE) EVT_CALL(GetLastEvent, ACTOR_SELF, LVarD) EVT_SWITCH(LVarD) - EVT_CASE_EQ(56) - EVT_CASE_EQ(9) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) + EVT_CASE_EQ(EVENT_HIT_COMBO) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CASE_EQ(10) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_CASE_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 2) - EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 2) + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN - EVT_CASE_EQ(14) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 2) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 2) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) EVT_SET(LVar0, 1) EVT_SET(LVar1, ANIM_KentCKoopa_Anim15) @@ -311,8 +325,8 @@ EvtScript N(handleEvent_80227E08) = { EVT_SET(LVar2, ANIM_KentCKoopa_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_END_IF - EVT_CASE_EQ(36) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) EVT_SET(LVar0, 1) EVT_SET(LVar1, ANIM_KentCKoopa_Anim15) @@ -324,75 +338,75 @@ EvtScript N(handleEvent_80227E08) = { EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, LVar2) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN - EVT_CASE_EQ(11) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 2) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 2) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) - EVT_EXEC_WAIT(N(8022B158)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) + EVT_EXEC_WAIT(N(EVS_Flipped_SpinSmashHit)) EVT_END_IF - EVT_CASE_EQ(33) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) - EVT_EXEC_WAIT(N(8022B204)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) + EVT_EXEC_WAIT(N(EVS_Flipped_SpinSmashDeath)) EVT_RETURN EVT_END_IF - EVT_CASE_EQ(47) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CASE_EQ(38) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN - EVT_CASE_EQ(23) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CASE_EQ(EVENT_ZERO_DAMAGE) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim09) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim1A) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF - EVT_CASE_EQ(25) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 2) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CASE_EQ(EVENT_IMMUNE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 2) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim09) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar2) @@ -402,12 +416,12 @@ EvtScript N(handleEvent_80227E08) = { EVT_WAIT(8) EVT_END_IF EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim1A) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF - EVT_CASE_EQ(31) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) EVT_SET(LVar1, ANIM_KentCKoopa_Anim01) EVT_ELSE @@ -415,55 +429,58 @@ EvtScript N(handleEvent_80227E08) = { EVT_END_IF EVT_SET(LVar0, 1) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_EQ(53) - EVT_EXEC_WAIT(N(8022AD84)) + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_EXEC_WAIT(N(EVS_KentC_GoHome)) EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(49) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim01) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim1A) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF - EVT_CASE_EQ(13) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CASE_EQ(EVENT_FLIP_TRIGGER) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim12) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_RETURN EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) + // each flip trigger decrements AVAR_FlipResistance by 1 + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_FlipResistance, LVar0) EVT_IF_GT(LVar0, 0) EVT_SUB(LVar0, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, LVar0) EVT_END_IF + // POW blocks immediately set AVAR_FlipResistance to 0 EVT_CALL(GetDamageSource, LVar0) EVT_IF_EQ(LVar0, DMG_SRC_POW_BLOCK) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 0) EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) + // if AVAR_FlipResistance is depleted, flip over + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_FlipResistance, LVar0) EVT_IF_EQ(LVar0, 0) EVT_CALL(GetBattleFlags, LVarD) EVT_IF_FLAG(LVarD, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 2) EVT_END_IF - EVT_EXEC_WAIT(N(flipOver_KentC)) + EVT_EXEC_WAIT(N(EVS_FlipOver)) EVT_ELSE EVT_CALL(GetBattleFlags, LVarD) EVT_IF_FLAG(LVarD, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 2) EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) EVT_IF_GT(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim1C) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim09) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar2) @@ -474,7 +491,7 @@ EvtScript N(handleEvent_80227E08) = { EVT_END_IF EVT_END_IF EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim1C) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF @@ -488,12 +505,11 @@ EvtScript N(handleEvent_80227E08) = { }; #include "common/StartRumbleWithParams.inc.c" - #include "common/battle/SetAbsoluteStatusOffsets.inc.c" -EvtScript N(takeTurn_80228A7C) = { - EVT_CALL(SetActorVar, ACTOR_SELF, 4, 2) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) +EvtScript N(EVS_TakeTurn) = { + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlipResistance, 2) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) @@ -502,9 +518,9 @@ EvtScript N(takeTurn_80228A7C) = { EVT_CALL(SetBattleCamOffsetZ, 20) EVT_CALL(BattleCamTargetActor, ACTOR_SELF) EVT_CALL(MoveBattleCamOver, 25) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_FlippedTurns, LVar0) EVT_SUB(LVar0, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlippedTurns, LVar0) EVT_IF_GT(LVar0, 0) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_ADD(LVar0, 36) @@ -539,7 +555,7 @@ EvtScript N(takeTurn_80228A7C) = { EVT_THREAD EVT_WAIT(3) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, 0x80000) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 27, 0) EVT_ELSE EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) @@ -556,7 +572,7 @@ EvtScript N(takeTurn_80228A7C) = { EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 2, EVT_FLOAT(0.5)) EVT_END_IF @@ -565,34 +581,34 @@ EvtScript N(takeTurn_80228A7C) = { EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KentCKoopa_Anim0C) EVT_WAIT(10) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_802279DC))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(NormalDefense))) EVT_CALL(SetEnemyTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 60) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, 0x00020000, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, 0x00800000, FALSE) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, 0x00020004) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, 0x00800004) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80227968))) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_WEAK_POINT, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_WEAK_POINT, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_FLIPPED, ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_4) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_MULTI_TARGET | ACTOR_PART_FLAG_4) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) EVT_CALL(N(SetAbsoluteStatusOffsets), -26, 38, 2, 63) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x0047001C) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_IsFlipped, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, ANIM_KentCKoopa_Anim1C) EVT_END_IF EVT_END_IF EVT_CALL(RandInt, 100, LVar0) EVT_IF_LT(LVar0, 50) EVT_CALL(GetStatusFlags, ACTOR_PARTNER, LVar0) - EVT_IF_NOT_FLAG(LVar0, 0x1000000) - EVT_EXEC_WAIT(N(shellToss_KentC)) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_KO) + EVT_EXEC_WAIT(N(EVS_Attack_ShellToss)) EVT_ELSE - EVT_EXEC_WAIT(N(tackle_KentC)) + EVT_EXEC_WAIT(N(EVS_Attack_HeavyStomp)) EVT_END_IF EVT_ELSE - EVT_EXEC_WAIT(N(tackle_KentC)) + EVT_EXEC_WAIT(N(EVS_Attack_HeavyStomp)) EVT_END_IF EVT_RETURN EVT_END }; -EvtScript N(shellToss_KentC) = { +EvtScript N(EVS_Attack_ShellToss) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) @@ -704,7 +720,7 @@ EvtScript N(shellToss_KentC) = { EVT_IF_NOT_FLAG(LVarE, STATUS_FLAG_SHRINK) EVT_CALL(SetDamageSource, DMG_SRC_CRUSH) EVT_END_IF - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, 0, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, 0, SUPPRESS_EVENT_ALL, 0, DMG_SHELL_TOSS_PLAYER, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SET(LVarA, 0) EVT_IF_NOT_FLAG(LVarE, STATUS_FLAG_SHRINK) EVT_CALL(GetBattleFlags, LVar0) @@ -726,7 +742,7 @@ EvtScript N(shellToss_KentC) = { EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(SetDamageSource, DMG_SRC_CRUSH_PARTNER) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, DMG_SHELL_TOSS_PARTNER, BS_FLAGS1_SP_EVT_ACTIVE) EVT_CALL(GetBattleFlags, LVar0) EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) EVT_CALL(SetGoalToTarget, ACTOR_SELF) @@ -763,7 +779,7 @@ EvtScript N(shellToss_KentC) = { EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) EVT_THREAD EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) EVT_END_IF @@ -773,7 +789,7 @@ EvtScript N(shellToss_KentC) = { EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) EVT_THREAD EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) EVT_END_IF @@ -783,7 +799,7 @@ EvtScript N(shellToss_KentC) = { EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE) EVT_THREAD EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) EVT_END_IF @@ -795,7 +811,7 @@ EvtScript N(shellToss_KentC) = { EVT_CALL(YieldTurn) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(MoveBattleCamOver, 20) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KentCKoopa_Anim01) @@ -805,7 +821,7 @@ EvtScript N(shellToss_KentC) = { EVT_END }; -EvtScript N(tackle_KentC) = { +EvtScript N(EVS_Attack_HeavyStomp) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) @@ -847,7 +863,7 @@ EvtScript N(tackle_KentC) = { EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EC) EVT_THREAD EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) EVT_END_IF @@ -859,7 +875,7 @@ EvtScript N(tackle_KentC) = { EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EC) EVT_THREAD EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) EVT_END_IF @@ -871,7 +887,7 @@ EvtScript N(tackle_KentC) = { EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EC) EVT_THREAD EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) EVT_END_IF @@ -921,22 +937,22 @@ EvtScript N(tackle_KentC) = { EVT_WAIT(2) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarF) - EVT_IF_NOT_FLAG(LVarF, 0x80000) + EVT_IF_NOT_FLAG(LVarF, STATUS_FLAG_SHRINK) EVT_CALL(SetDamageSource, DMG_SRC_CRUSH) EVT_END_IF - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, 0, SUPPRESS_EVENT_ALL, 0, 10, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, 0, SUPPRESS_EVENT_ALL, 0, DMG_HEAVY_STOMP, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVarF) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(10) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CASE_OR_EQ(HIT_RESULT_10) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(MoveBattleCamOver, 30) EVT_CALL(GetBattleFlags, LVar0) EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) - EVT_IF_NOT_FLAG(LVar0, 0x100000) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_STONE) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarE) - EVT_IF_NOT_FLAG(LVarE, 0x80000) + EVT_IF_NOT_FLAG(LVarE, STATUS_FLAG_SHRINK) EVT_CALL(LandJump, ACTOR_SELF) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EC) EVT_END_IF @@ -945,7 +961,7 @@ EvtScript N(tackle_KentC) = { EVT_THREAD EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) EVT_END_IF @@ -963,7 +979,7 @@ EvtScript N(tackle_KentC) = { EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EC) EVT_THREAD EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) EVT_END_IF @@ -975,7 +991,7 @@ EvtScript N(tackle_KentC) = { EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EC) EVT_THREAD EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, 0x80000) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_CALL(N(StartRumbleWithParams), 80, 14) EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) EVT_END_IF @@ -986,8 +1002,8 @@ EvtScript N(tackle_KentC) = { EVT_END_IF EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(MoveBattleCamOver, 20) - EVT_EXEC_WAIT(N(8022AD84)) - EVT_CASE_EQ(3) + EVT_EXEC_WAIT(N(EVS_KentC_GoHome)) + EVT_CASE_EQ(HIT_RESULT_3) EVT_END_CASE_GROUP EVT_END_SWITCH EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) @@ -996,22 +1012,22 @@ EvtScript N(tackle_KentC) = { EVT_END }; -EvtScript N(8022AD84) = { - EVT_SET_CONST(LVar0, 0x00000001) +EvtScript N(EVS_KentC_GoHome) = { + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KentCKoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_RETURN EVT_END }; -EvtScript N(flipOver_KentC) = { +EvtScript N(EVS_FlipOver) = { EVT_CALL(SetEnemyTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 40) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_802279F0))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_802279B4))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(FlippedDefense))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(FlippedAnims))) EVT_CALL(N(SetAbsoluteStatusOffsets), -24, 47, 23, 37) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KentCKoopa_Anim1C) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, ANIM_KentCKoopa_Anim12) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_IsFlipped, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Hurt, ANIM_KentCKoopa_Anim12) EVT_THREAD EVT_WAIT(4) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) @@ -1048,22 +1064,20 @@ EvtScript N(flipOver_KentC) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KentCKoopa_Anim1D) EVT_WAIT(1) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KentCKoopa_Anim1E) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_NO_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, 4) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_WEAK_POINT, ACTOR_PART_FLAG_NO_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_WEAK_POINT, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_FLIPPED, ACTOR_PART_FLAG_4) EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_4) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlippedTurns, 1) EVT_WAIT(8) EVT_RETURN EVT_END }; -extern EvtScript N(8022B2E8); - -EvtScript N(8022B158) = { +EvtScript N(EVS_Flipped_SpinSmashHit) = { EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) EVT_SET(LVarA, 5) - EVT_EXEC_WAIT(N(8022B2E8)) + EVT_EXEC_WAIT(N(EVS_DropDummyCoins)) EVT_SET(LVar2, 0) EVT_LOOP(36) EVT_ADD(LVar2, 30) @@ -1075,10 +1089,10 @@ EvtScript N(8022B158) = { EVT_END }; -EvtScript N(8022B204) = { +EvtScript N(EVS_Flipped_SpinSmashDeath) = { EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) EVT_SET(LVarA, 0) - EVT_EXEC_WAIT(N(8022B2E8)) + EVT_EXEC_WAIT(N(EVS_DropDummyCoins)) EVT_SET(LVar2, 0) EVT_LOOP(48) EVT_ADD(LVar2, 30) @@ -1087,21 +1101,21 @@ EvtScript N(8022B204) = { EVT_END_LOOP EVT_CALL(SetActorYaw, ACTOR_SELF, 0) EVT_WAIT(10) - EVT_SET(LVar0, 1) + EVT_SET(LVar0, PRT_MAIN) EVT_SET(LVar1, -1) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END }; -extern EvtScript N(8022B444); - -EvtScript N(8022B2E8) = { +// when hit with Spin Smash while flipped over, coins fly out +// (in) LVarA : delay between each coin release +EvtScript N(EVS_DropDummyCoins) = { EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, 0x80000) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_RETURN EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar3) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_CoinsToDrop, LVar3) EVT_CALL(GetLastDamage, ACTOR_SELF, LVar4) EVT_IF_GT(LVar4, LVar3) EVT_SET(LVar4, LVar3) @@ -1112,10 +1126,10 @@ EvtScript N(8022B2E8) = { EVT_IF_GT(LVar4, 0) EVT_THREAD EVT_SUB(LVar3, LVar4) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, LVar3) - EVT_SET(LVar5, 4) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_CoinsToDrop, LVar3) + EVT_SET(LVar5, PRT_DUMMY_COIN_1) EVT_LOOP(LVar4) - EVT_EXEC(N(8022B444)) + EVT_EXEC(N(EVS_DropDummyCoin)) EVT_ADD(LVar5, 1) EVT_WAIT(LVarA) EVT_END_LOOP @@ -1125,29 +1139,29 @@ EvtScript N(8022B2E8) = { EVT_END }; -API_CALLABLE(func_80218C74_48DE14) { +API_CALLABLE(N(GetCoinTrajectory)) { Bytecode* args = script->ptrReadPos; s32 x = evt_get_variable(script, *args++); s32 z = evt_get_variable(script, *args++); - f32 rand = rand_int(0x168); + f32 angle = rand_int(360); - f32 fx = x; - f32 fz = z; + f32 centerX = x; + f32 centerZ = z; - s32 outX1 = fx + cos_deg(rand) * 46.0f; - s32 outZ1 = fz + sin_deg(rand) * 46.0f; - s32 outX2 = fx + cos_deg(rand) * 62.0f; - s32 outZ2 = fz + sin_deg(rand) * 62.0f; + s32 startX = centerX + cos_deg(angle) * 46.0f; + s32 startZ = centerZ + sin_deg(angle) * 46.0f; + s32 endX = centerX + cos_deg(angle) * 62.0f; + s32 endZ = centerZ + sin_deg(angle) * 62.0f; - evt_set_variable(script, *args++, outX1); - evt_set_variable(script, *args++, outZ1); - evt_set_variable(script, *args++, outX2); - evt_set_variable(script, *args++, outZ2); + evt_set_variable(script, *args++, startX); + evt_set_variable(script, *args++, startZ); + evt_set_variable(script, *args++, endX); + evt_set_variable(script, *args++, endZ); return ApiStatus_DONE2; } -API_CALLABLE(func_80218DF8_48DF98) { +API_CALLABLE(N(UnusedFunc)) { Bytecode* args = script->ptrReadPos; Bytecode var1 = *args++; @@ -1155,23 +1169,24 @@ API_CALLABLE(func_80218DF8_48DF98) { return ApiStatus_DONE2; } - -EvtScript N(8022B444) = { +EvtScript N(EVS_DropDummyCoin) = { EVT_CALL(PlaySoundAtPart, ACTOR_SELF, LVar5, SOUND_212) EVT_CALL(GetActorPos, ACTOR_SELF, LVar6, LVar7, LVar8) EVT_CALL(SetPartPos, ACTOR_SELF, LVar5, LVar6, 35, LVar8) - EVT_CALL(func_80218C74_48DE14, LVar6, LVar8, LVar0, LVar1, LVar2, LVar3) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar5, 1, FALSE) + EVT_CALL(N(GetCoinTrajectory), LVar6, LVar8, LVar0, LVar1, LVar2, LVar3) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar5, ACTOR_PART_FLAG_INVISIBLE, FALSE) EVT_CALL(SetPartJumpGravity, ACTOR_SELF, LVar5, EVT_FLOAT(1.0)) EVT_CALL(JumpPartTo, ACTOR_SELF, LVar5, LVar0, 0, LVar1, 18, TRUE) EVT_CALL(JumpPartTo, ACTOR_SELF, LVar5, LVar2, 0, LVar3, 9, TRUE) EVT_WAIT(10) + // blinking EVT_LOOP(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar5, 1, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar5, ACTOR_PART_FLAG_INVISIBLE, FALSE) EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar5, 1, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar5, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_WAIT(1) EVT_END_LOOP + // give coin to player EVT_CALL(PlaySoundAtPart, ACTOR_SELF, LVar5, SOUND_211) EVT_CALL(AddCoin, 1) EVT_RETURN diff --git a/src/battle/area/nok/actor/koopa_troopa.c b/src/battle/area/nok/actor/koopa_troopa.c index 8a17904302..2c15873fca 100644 --- a/src/battle/area/nok/actor/koopa_troopa.c +++ b/src/battle/area/nok/actor/koopa_troopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_nok_koopa_troopa +#include "../area.h" #include "battle/common/actor/koopa_troopa.inc.c" diff --git a/src/battle/area/nok/actor/paragoomba.c b/src/battle/area/nok/actor/paragoomba.c index 9f29d3c247..2d2fefd360 100644 --- a/src/battle/area/nok/actor/paragoomba.c +++ b/src/battle/area/nok/actor/paragoomba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_nok_paragoomba +#include "../area.h" #include "battle/common/actor/paragoomba.inc.c" diff --git a/src/battle/area/nok/actor/paratroopa.c b/src/battle/area/nok/actor/paratroopa.c index 6bd2770149..746d24e524 100644 --- a/src/battle/area/nok/actor/paratroopa.c +++ b/src/battle/area/nok/actor/paratroopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_nok_paratroopa +#include "../area.h" #include "battle/common/actor/paratroopa.inc.c" diff --git a/src/battle/area/nok/actor/spiked_goomba.c b/src/battle/area/nok/actor/spiked_goomba.c index dfe7578a77..50037b0556 100644 --- a/src/battle/area/nok/actor/spiked_goomba.c +++ b/src/battle/area/nok/actor/spiked_goomba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_nok_spiked_goomba +#include "../area.h" #include "battle/common/actor/spiked_goomba.inc.c" diff --git a/src/battle/area/nok/area.c b/src/battle/area/nok/area.c index 077727703f..f705cb8947 100644 --- a/src/battle/area/nok/area.c +++ b/src/battle/area/nok/area.c @@ -1,194 +1,190 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "area.h" -#define NAMESPACE b_area_nok +extern ActorBlueprint A(goomba); +extern ActorBlueprint A(spiked_goomba); +extern ActorBlueprint A(paragoomba); +extern ActorBlueprint A(koopa_troopa); +extern ActorBlueprint A(paratroopa); +extern ActorBlueprint A(fuzzy); +extern ActorBlueprint A(kent_c_koopa); -extern ActorBlueprint N(goomba); -extern ActorBlueprint N(spiked_goomba); -extern ActorBlueprint N(paragoomba); -extern ActorBlueprint N(koopa_troopa); -extern ActorBlueprint N(paratroopa); -extern ActorBlueprint N(fuzzy); -extern ActorBlueprint N(kent_c_koopa); +extern Stage A(nok_01); +extern Stage A(nok_02); +extern Stage A(nok_03); +extern Stage A(nok_04); -extern Stage N(nok_01); -extern Stage N(nok_02); -extern Stage N(nok_03); -extern Stage N(nok_04); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(goomba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(goomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(goomba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(goomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(goomba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(goomba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(paragoomba), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(paragoomba), BTL_POS_AIR_C, 9), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(paragoomba), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(paragoomba), BTL_POS_AIR_C, 9), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(paragoomba), BTL_POS_AIR_C, 9), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(paragoomba), BTL_POS_AIR_C, 9), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(goomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(goomba), BTL_POS_GROUND_C, 8), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(goomba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 8), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_D, 7), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(goomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(goomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_C, 9), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 8), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 8), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(paragoomba), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(paragoomba), BTL_POS_AIR_C, 8), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(paragoomba), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(paragoomba), BTL_POS_AIR_C, 8), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(paragoomba), BTL_POS_AIR_C, 8), +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(paragoomba), BTL_POS_AIR_C, 8), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(paragoomba), BTL_POS_AIR_D, 7), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(paragoomba), BTL_POS_AIR_D, 7), }; -Formation N(Formation_11) = { - ACTOR_BY_IDX(N(paratroopa), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(paratroopa), BTL_POS_AIR_C, 9), +Formation A(Formation_11) = { + ACTOR_BY_IDX(A(paratroopa), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(paratroopa), BTL_POS_AIR_C, 9), }; -Formation N(Formation_12) = { - ACTOR_BY_IDX(N(paratroopa), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_C, 9), +Formation A(Formation_12) = { + ACTOR_BY_IDX(A(paratroopa), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_13) = { - ACTOR_BY_IDX(N(paratroopa), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 8), +Formation A(Formation_13) = { + ACTOR_BY_IDX(A(paratroopa), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_14) = { - ACTOR_BY_IDX(N(paratroopa), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(koopa_troopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(spiked_goomba), BTL_POS_GROUND_D, 7), +Formation A(Formation_14) = { + ACTOR_BY_IDX(A(paratroopa), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(koopa_troopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(spiked_goomba), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_15) = { - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_B, 10), +Formation A(Formation_15) = { + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_16) = { - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_C, 9), +Formation A(Formation_16) = { + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_17) = { - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_D, 7), +Formation A(Formation_17) = { + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_18) = { - ACTOR_BY_IDX(N(kent_c_koopa), BTL_POS_GROUND_B, 10), +Formation A(Formation_18) = { + ACTOR_BY_IDX(A(kent_c_koopa), BTL_POS_GROUND_B, 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(nok_02), "クリボーx2"), - BATTLE(N(Formation_01), N(nok_02), "クリボー,トゲクリボー"), - BATTLE(N(Formation_02), N(nok_02), "パタクリボーx2"), - BATTLE(N(Formation_03), N(nok_02), "トゲクリボー、パタクリボー"), - BATTLE(N(Formation_04), N(nok_02), "トゲクリボーx2"), - BATTLE(N(Formation_05), N(nok_02), "トゲクリボー、クリボーx2"), - BATTLE(N(Formation_06), N(nok_02), "トゲクリボーx3"), - BATTLE(N(Formation_07), N(nok_02), "トゲクリボーx4"), - BATTLE(N(Formation_08), N(nok_02), "ノコノコ、クリボー"), - BATTLE(N(Formation_09), N(nok_02), "ノコノコx2"), - BATTLE(N(Formation_0A), N(nok_02), "ノコノコx3"), - BATTLE(N(Formation_0B), N(nok_02), "ノコノコ、トゲクリボー"), - BATTLE(N(Formation_0C), N(nok_02), "ノコノコx2、トゲクリ"), - BATTLE(N(Formation_0D), N(nok_02), "ノコノコ、トゲクリボーx2"), - BATTLE(N(Formation_0E), N(nok_02), "ノコノコ、パタクリボーx2"), - BATTLE(N(Formation_0F), N(nok_02), "ノコノコ、トゲクリボー,パタクリボー"), - BATTLE(N(Formation_10), N(nok_02), "ノコノコx2、トゲクリボー,パタクリボー"), - BATTLE(N(Formation_11), N(nok_02), "パタパタx2"), - BATTLE(N(Formation_12), N(nok_02), "パタパタ、ノコノコ"), - BATTLE(N(Formation_13), N(nok_02), "パタパタ、ノコノコ、トゲクリボー"), - BATTLE(N(Formation_14), N(nok_02), "パタパタ、ノコノコ、トゲクリボーx2"), - BATTLE(N(Formation_15), N(nok_02), "チョロボン"), - BATTLE(N(Formation_16), N(nok_02), "チョロボンx2"), - BATTLE(N(Formation_17), N(nok_02), "チョロボンx4"), - BATTLE(N(Formation_18), N(nok_02), "ゼニノコー"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(nok_02), "クリボーx2"), + BATTLE(A(Formation_01), A(nok_02), "クリボー,トゲクリボー"), + BATTLE(A(Formation_02), A(nok_02), "パタクリボーx2"), + BATTLE(A(Formation_03), A(nok_02), "トゲクリボー、パタクリボー"), + BATTLE(A(Formation_04), A(nok_02), "トゲクリボーx2"), + BATTLE(A(Formation_05), A(nok_02), "トゲクリボー、クリボーx2"), + BATTLE(A(Formation_06), A(nok_02), "トゲクリボーx3"), + BATTLE(A(Formation_07), A(nok_02), "トゲクリボーx4"), + BATTLE(A(Formation_08), A(nok_02), "ノコノコ、クリボー"), + BATTLE(A(Formation_09), A(nok_02), "ノコノコx2"), + BATTLE(A(Formation_0A), A(nok_02), "ノコノコx3"), + BATTLE(A(Formation_0B), A(nok_02), "ノコノコ、トゲクリボー"), + BATTLE(A(Formation_0C), A(nok_02), "ノコノコx2、トゲクリ"), + BATTLE(A(Formation_0D), A(nok_02), "ノコノコ、トゲクリボーx2"), + BATTLE(A(Formation_0E), A(nok_02), "ノコノコ、パタクリボーx2"), + BATTLE(A(Formation_0F), A(nok_02), "ノコノコ、トゲクリボー,パタクリボー"), + BATTLE(A(Formation_10), A(nok_02), "ノコノコx2、トゲクリボー,パタクリボー"), + BATTLE(A(Formation_11), A(nok_02), "パタパタx2"), + BATTLE(A(Formation_12), A(nok_02), "パタパタ、ノコノコ"), + BATTLE(A(Formation_13), A(nok_02), "パタパタ、ノコノコ、トゲクリボー"), + BATTLE(A(Formation_14), A(nok_02), "パタパタ、ノコノコ、トゲクリボーx2"), + BATTLE(A(Formation_15), A(nok_02), "チョロボン"), + BATTLE(A(Formation_16), A(nok_02), "チョロボンx2"), + BATTLE(A(Formation_17), A(nok_02), "チョロボンx4"), + BATTLE(A(Formation_18), A(nok_02), "ゼニノコー"), {}, }; -StageList N(Stages) = { - STAGE("nok_01", N(nok_01)), - STAGE("nok_02", N(nok_02)), - STAGE("nok_03", N(nok_03)), - STAGE("nok_04", N(nok_04)), +StageList A(Stages) = { + STAGE("nok_01", A(nok_01)), + STAGE("nok_02", A(nok_02)), + STAGE("nok_03", A(nok_03)), + STAGE("nok_04", A(nok_04)), {}, }; diff --git a/src/battle/area/nok/area.h b/src/battle/area/nok/area.h new file mode 100644 index 0000000000..7050f229f2 --- /dev/null +++ b/src/battle/area/nok/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_nok diff --git a/src/battle/area/nok/stage/nok_01.c b/src/battle/area/nok/stage/nok_01.c index 654305b72b..29cafe42c3 100644 --- a/src/battle/area/nok/stage/nok_01.c +++ b/src/battle/area/nok/stage/nok_01.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_nok_nok_01 - -#include "battle/common/stage/nok_01.inc.c" +#include "battle/common/stage/area_nok/nok_01.inc.c" diff --git a/src/battle/area/nok/stage/nok_02.c b/src/battle/area/nok/stage/nok_02.c index 6c58b2c6b6..c2015cad4f 100644 --- a/src/battle/area/nok/stage/nok_02.c +++ b/src/battle/area/nok/stage/nok_02.c @@ -1,83 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/nok_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_nok_nok_02 - -EvtScript N(EVS_AnimateFlower) = { - EVT_SET(LVarA, LVar0) - EVT_LABEL(0) - EVT_CALL(TranslateModel, LVarA, 0, 2, 0) - EVT_WAIT(5) - EVT_CALL(TranslateModel, LVarA, 0, 0, 0) - EVT_WAIT(5) - EVT_CALL(TranslateModel, LVarA, 0, 2, 0) - EVT_WAIT(5) - EVT_CALL(TranslateModel, LVarA, 0, 0, 0) - EVT_WAIT(5) - EVT_CALL(RandInt, 30, LVar0) - EVT_ADD(LVar0, 30) - EVT_WAIT(LVar0) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_THREAD - EVT_SET(LVar0, MODEL_h1) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h3) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h4) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h5) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h6) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h7) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h9) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h10) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h11) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_WAIT(5) - EVT_SET(LVar0, MODEL_h12) - EVT_EXEC(N(EVS_AnimateFlower)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_ha3, - MODEL_hap, - MODEL_kusa3, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "nok_tex", - .shape = "nok_bt02_shape", - .hit = "nok_bt02_hit", - .bg = "nok_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_nok/nok_02.inc.c" diff --git a/src/battle/area/nok/stage/nok_03.c b/src/battle/area/nok/stage/nok_03.c index d1067ab43f..0e3a8c86d3 100644 --- a/src/battle/area/nok/stage/nok_03.c +++ b/src/battle/area/nok/stage/nok_03.c @@ -1,32 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/nok_bt03_shape.h" +#include "../area.h" -#define NAMESPACE b_area_nok_nok_03 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_ha3, - MODEL_hap, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "nok_tex", - .shape = "nok_bt03_shape", - .hit = "nok_bt03_hit", - .bg = "nok_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_nok/nok_03.inc.c" diff --git a/src/battle/area/nok/stage/nok_04.c b/src/battle/area/nok/stage/nok_04.c index 1143e20409..b4d8dfbf03 100644 --- a/src/battle/area/nok/stage/nok_04.c +++ b/src/battle/area/nok/stage/nok_04.c @@ -1,35 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/nok_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_nok_nok_04 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_ueki2, - MODEL_ueki1, - MODEL_kabu2, - MODEL_kabu1, - MODEL_kusa3, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "nok_tex", - .shape = "nok_bt04_shape", - .hit = "nok_bt04_hit", - .bg = "nok_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_nok/nok_04.inc.c" diff --git a/src/battle/area/omo/actor/anti_guy.c b/src/battle/area/omo/actor/anti_guy.c index 5867cf1d30..c13f218b81 100644 --- a/src/battle/area/omo/actor/anti_guy.c +++ b/src/battle/area/omo/actor/anti_guy.c @@ -1,497 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ShyGuy.h" +#include "../area.h" -#define NAMESPACE b_area_omo_anti_guy - -extern s32 N(IdleAnimations_80221A14)[]; -extern EvtScript N(init_80221A60); -extern EvtScript N(takeTurn_802233AC); -extern EvtScript N(idle_80221AAC); -extern EvtScript N(handleEvent_80221C20); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable_80221910)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8022191C)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 50, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 60, - STATUS_KEY_SHRINK, 50, - STATUS_KEY_STOP, 50, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, -1, - STATUS_TURN_MOD_STOP, -2, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts_802219C8)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80221A14), - .defenseTable = N(DefenseTable_80221910), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_ANTI_GUY, - .level = 42, - .maxHP = 50, - .partCount = ARRAY_COUNT( N(ActorParts_802219C8)), - .partsData = N(ActorParts_802219C8), - .initScript = &N(init_80221A60), - .statusTable = N(StatusTable_8022191C), - .escapeChance = 50, - .airLiftChance = 0, - .hurricaneChance = 0, - .spookChance = 0, - .upAndAwayChance = 0, - .spinSmashReq = 0, - .powerBounceChance = 75, - .coinReward = 0, - .size = { 30, 30 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_80221A14)[] = { - STATUS_KEY_NORMAL, ANIM_ShyGuy_Black_Anim01, - STATUS_KEY_STONE, ANIM_ShyGuy_Black_Anim00, - STATUS_KEY_SLEEP, ANIM_ShyGuy_Black_Anim12, - STATUS_KEY_POISON, ANIM_ShyGuy_Black_Anim01, - STATUS_KEY_STOP, ANIM_ShyGuy_Black_Anim00, - STATUS_KEY_STATIC, ANIM_ShyGuy_Black_Anim01, - STATUS_KEY_PARALYZE, ANIM_ShyGuy_Black_Anim00, - STATUS_KEY_DIZZY, ANIM_ShyGuy_Black_Anim13, - STATUS_KEY_FEAR, ANIM_ShyGuy_Black_Anim13, - STATUS_END, -}; - -EvtScript N(init_80221A60) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_802233AC))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80221AAC))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80221C20))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_80221AAC) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80221BBC) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80221C20) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Black_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Black_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(80221BBC)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim03) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Black_Anim14) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(802220FC) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_END_THREAD - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim05) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 10, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_WAIT(8) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(80221BBC)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80222824) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 80) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) - EVT_THREAD - EVT_WAIT(12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) - EVT_THREAD - EVT_WAIT(9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 12, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(20) - EVT_SUB(LVar3, 30) - EVT_IF_LT(LVar3, 0) - EVT_ADD(LVar3, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim07) - EVT_WAIT(15) - EVT_GOTO(2) - EVT_LABEL(1) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim10) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 50) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim11) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim13) - EVT_END_IF - EVT_WAIT(25) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_LABEL(2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_802233AC) = { - EVT_CALL(RandInt, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_EXEC_WAIT(N(802220FC)) - EVT_ELSE - EVT_EXEC_WAIT(N(80222824)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/anti_guy.inc.c" diff --git a/src/battle/area/omo/actor/blue_shy_guy.c b/src/battle/area/omo/actor/blue_shy_guy.c index 31cf9cd84d..cf11fc86c4 100644 --- a/src/battle/area/omo/actor/blue_shy_guy.c +++ b/src/battle/area/omo/actor/blue_shy_guy.c @@ -1,498 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ShyGuy.h" +#include "../area.h" -#define NAMESPACE b_area_omo_blue_shy_guy - -extern s32 N(IdleAnimations_8021AE1C)[]; -extern EvtScript N(init_8021AE68); -extern EvtScript N(takeTurn_8021C7B4); -extern EvtScript N(idle_8021AEB4); -extern EvtScript N(handleEvent_8021B028); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable_8021AD10)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_SHOCK, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8021AD24)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021AE1C), - .defenseTable = N(DefenseTable_8021AD10), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_SHY_GUY, - .level = 14, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021AE68), - .statusTable = N(StatusTable_8021AD24), - .escapeChance = 60, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 80, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 28, 24 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_8021AE1C)[] = { - STATUS_KEY_NORMAL, ANIM_ShyGuy_Blue_Anim01, - STATUS_KEY_STONE, ANIM_ShyGuy_Blue_Anim00, - STATUS_KEY_SLEEP, ANIM_ShyGuy_Blue_Anim12, - STATUS_KEY_POISON, ANIM_ShyGuy_Blue_Anim01, - STATUS_KEY_STOP, ANIM_ShyGuy_Blue_Anim00, - STATUS_KEY_STATIC, ANIM_ShyGuy_Blue_Anim01, - STATUS_KEY_PARALYZE, ANIM_ShyGuy_Blue_Anim00, - STATUS_KEY_DIZZY, ANIM_ShyGuy_Blue_Anim13, - STATUS_KEY_FEAR, ANIM_ShyGuy_Blue_Anim13, - STATUS_END, -}; - -EvtScript N(init_8021AE68) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021C7B4))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021AEB4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021B028))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_8021AEB4) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021AFC4) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021B028) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Blue_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Blue_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8021AFC4)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim03) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Blue_Anim14) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021B504) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_END_THREAD - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim05) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) - EVT_WAIT(8) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(8021AFC4)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021BC2C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim09) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 80) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim09) - EVT_THREAD - EVT_WAIT(12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim09) - EVT_THREAD - EVT_WAIT(9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(20) - EVT_SUB(LVar3, 30) - EVT_IF_LT(LVar3, 0) - EVT_ADD(LVar3, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim09) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim07) - EVT_WAIT(15) - EVT_GOTO(2) - EVT_LABEL(1) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim10) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 50) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim11) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim13) - EVT_END_IF - EVT_WAIT(25) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_LABEL(2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021C7B4) = { - EVT_CALL(RandInt, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_EXEC_WAIT(N(8021B504)) - EVT_ELSE - EVT_EXEC_WAIT(N(8021BC2C)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/blue_shy_guy.inc.c" diff --git a/src/battle/area/omo/actor/green_shy_guy.c b/src/battle/area/omo/actor/green_shy_guy.c index 49ea3b86f0..9463b2e5ea 100644 --- a/src/battle/area/omo/actor/green_shy_guy.c +++ b/src/battle/area/omo/actor/green_shy_guy.c @@ -1,498 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ShyGuy.h" +#include "../area.h" -#define NAMESPACE b_area_omo_green_shy_guy - -extern s32 N(IdleAnimations_8021FF1C)[]; -extern EvtScript N(init_8021FF68); -extern EvtScript N(takeTurn_802218B4); -extern EvtScript N(idle_8021FFB4); -extern EvtScript N(handleEvent_80220128); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable_8021FE10)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_SHOCK, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8021FE24)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021FF1C), - .defenseTable = N(DefenseTable_8021FE10), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_SHY_GUY, - .level = 14, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021FF68), - .statusTable = N(StatusTable_8021FE24), - .escapeChance = 60, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 80, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 28, 24 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_8021FF1C)[] = { - STATUS_KEY_NORMAL, ANIM_ShyGuy_Green_Anim01, - STATUS_KEY_STONE, ANIM_ShyGuy_Green_Anim00, - STATUS_KEY_SLEEP, ANIM_ShyGuy_Green_Anim12, - STATUS_KEY_POISON, ANIM_ShyGuy_Green_Anim01, - STATUS_KEY_STOP, ANIM_ShyGuy_Green_Anim00, - STATUS_KEY_STATIC, ANIM_ShyGuy_Green_Anim01, - STATUS_KEY_PARALYZE, ANIM_ShyGuy_Green_Anim00, - STATUS_KEY_DIZZY, ANIM_ShyGuy_Green_Anim13, - STATUS_KEY_FEAR, ANIM_ShyGuy_Green_Anim13, - STATUS_END, -}; - -EvtScript N(init_8021FF68) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_802218B4))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021FFB4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80220128))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_8021FFB4) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(802200C4) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80220128) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Green_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Green_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(802200C4)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim03) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Green_Anim14) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80220604) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_END_THREAD - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim05) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) - EVT_WAIT(8) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(802200C4)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80220D2C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim09) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 80) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim09) - EVT_THREAD - EVT_WAIT(12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim09) - EVT_THREAD - EVT_WAIT(9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(20) - EVT_SUB(LVar3, 30) - EVT_IF_LT(LVar3, 0) - EVT_ADD(LVar3, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim09) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim07) - EVT_WAIT(15) - EVT_GOTO(2) - EVT_LABEL(1) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim10) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 50) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim11) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim13) - EVT_END_IF - EVT_WAIT(25) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_LABEL(2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_802218B4) = { - EVT_CALL(RandInt, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_EXEC_WAIT(N(80220604)) - EVT_ELSE - EVT_EXEC_WAIT(N(80220D2C)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/green_shy_guy.inc.c" diff --git a/src/battle/area/omo/actor/groove_guy.c b/src/battle/area/omo/actor/groove_guy.c index 124717973e..e0f65dc3e8 100644 --- a/src/battle/area/omo/actor/groove_guy.c +++ b/src/battle/area/omo/actor/groove_guy.c @@ -1,834 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ShyGuy.h" -#include "sprite/npc/MediGuy.h" -#include "sprite/npc/GrooveGuy.h" +#include "../area.h" -#define AREA b_area_omo -#define NAMESPACE A(groove_guy) - -extern EvtScript N(init_80224B38); -extern EvtScript N(takeTurn_80226338); -extern EvtScript N(idle_80224B9C); -extern EvtScript N(handleEvent_80224D10); -extern EvtScript N(randomSummon); -extern EvtScript N(80226C00); -extern EvtScript N(80226DEC); -extern EvtScript N(802271A0); -extern Formation N(specialFormation_802273A8); -extern Formation N(specialFormation_802273C4); -extern Formation N(specialFormation_802273E0); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(IdleAnimations_802249E0)[] = { - STATUS_KEY_NORMAL, ANIM_GrooveGuy_Anim01, - STATUS_KEY_STONE, ANIM_GrooveGuy_Anim00, - STATUS_KEY_SLEEP, ANIM_GrooveGuy_Anim06, - STATUS_KEY_POISON, ANIM_GrooveGuy_Anim01, - STATUS_KEY_STOP, ANIM_GrooveGuy_Anim00, - STATUS_KEY_STATIC, ANIM_GrooveGuy_Anim01, - STATUS_KEY_PARALYZE, ANIM_GrooveGuy_Anim00, - STATUS_KEY_DIZZY, ANIM_GrooveGuy_Anim07, - STATUS_KEY_FEAR, ANIM_GrooveGuy_Anim07, - STATUS_END, -}; - -s32 N(DefenseTable_80224A2C)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_SHOCK, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_80224A40)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 80, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -BSS PlayerStatus D_802310D0; - -ActorPartBlueprint N(ActorParts_80224AEC)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_802249E0), - .defenseTable = N(DefenseTable_80224A2C), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_GROOVE_GUY, - .level = 15, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts_80224AEC)), - .partsData = N(ActorParts_80224AEC), - .initScript = &N(init_80224B38), - .statusTable = N(StatusTable_80224A40), - .escapeChance = 50, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 70, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 80, - .coinReward = 2, - .size = { 28, 28 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(init_80224B38) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80226338))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80224B9C))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80224D10))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_80224B9C) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -13, 15, 4, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80224CAC) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80224D10) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim0E) - EVT_SET_CONST(LVar2, ANIM_GrooveGuy_Anim0F) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim0E) - EVT_SET_CONST(LVar2, ANIM_GrooveGuy_Anim0F) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim0F) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(80224CAC)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim04) - EVT_SET_CONST(LVar2, ANIM_GrooveGuy_Anim11) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_OR_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(basicAttack) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim10) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(80224CAC)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_END_THREAD - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim10) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim01) - EVT_WAIT(8) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(80224CAC)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(sleepySpin) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim10) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) - EVT_SET(LVar0, 0) - EVT_LOOP(30) - EVT_ADD(LVar0, 48) - EVT_MOD(LVar0, 360) - EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B) - EVT_WAIT(20) - EVT_IF_EQ(LVar0, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(80224CAC)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, DMG_STATUS_KEY(STATUS_FLAG_DIZZY, 2, 50), 0, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(WasStatusInflicted, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar0, TRUE) - EVT_THREAD - EVT_SET(LVar0, 0) - EVT_LOOP(30) - EVT_ADD(LVar0, 48) - EVT_MOD(LVar0, 360) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorYaw, ACTOR_PLAYER, 0) - EVT_END_THREAD - EVT_END_IF - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E3) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B) - EVT_SET(LVar0, 0) - EVT_LOOP(15) - EVT_ADD(LVar0, 24) - EVT_MOD(LVar0, 360) - EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E4) - EVT_THREAD - EVT_SET(LVar0, 0) - EVT_LOOP(20) - EVT_ADD(LVar0, 72) - EVT_MOD(LVar0, 360) - EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) - EVT_END_THREAD - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0A) - EVT_WAIT(25) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(80224CAC)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(getFirstOpenColumn) = { - EVT_SET(LFlag1, FALSE) - EVT_SET(LFlag2, FALSE) - EVT_SET(LFlag3, FALSE) - EVT_SET(LFlag4, FALSE) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar5) - EVT_CALL(GetIndexFromHome, LVar0, LVar5) - EVT_MOD(LVar5, 4) - EVT_SWITCH(LVar5) - EVT_CASE_EQ(0) - EVT_SET(LFlag1, TRUE) - EVT_CASE_EQ(1) - EVT_SET(LFlag2, TRUE) - EVT_CASE_EQ(2) - EVT_SET(LFlag3, TRUE) - EVT_CASE_EQ(3) - EVT_SET(LFlag4, TRUE) - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_IF_EQ(LFlag1, FALSE) - EVT_SET(LVarA, 0) - EVT_RETURN - EVT_END_IF - EVT_IF_EQ(LFlag2, FALSE) - EVT_SET(LVarA, 1) - EVT_RETURN - EVT_END_IF - EVT_IF_EQ(LFlag3, FALSE) - EVT_SET(LVarA, 2) - EVT_RETURN - EVT_END_IF - EVT_IF_EQ(LFlag4, FALSE) - EVT_SET(LVarA, 3) - EVT_RETURN - EVT_END_IF - EVT_SET(LVarA, -1) - EVT_RETURN - EVT_END -}; - -EvtScript N(countActiveSummoners) = { - EVT_SET(LVar9, 0) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetOriginalActorType, LVar0, LVar2) - EVT_SWITCH(LVar2) - EVT_CASE_EQ(ACTOR_TYPE_GROOVE_GUY) - EVT_CALL(GetStatusFlags, LVar0, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(GetActorVar, LVar0, 0, LVar3) - EVT_IF_NE(LVar3, 2) - EVT_ADD(LVar9, 1) - EVT_END_IF - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_80226338) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_EQ(LVar0, 2) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 60) - EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_DIZZY) - EVT_EXEC_WAIT(N(basicAttack)) - EVT_ELSE - EVT_EXEC_WAIT(N(sleepySpin)) - EVT_END_IF - EVT_ELSE - EVT_EXEC_WAIT(N(basicAttack)) - EVT_END_IF - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(getFirstOpenColumn)) - EVT_IF_EQ(LVarA, -1) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 60) - EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_DIZZY) - EVT_EXEC_WAIT(N(basicAttack)) - EVT_ELSE - EVT_EXEC_WAIT(N(sleepySpin)) - EVT_END_IF - EVT_ELSE - EVT_EXEC_WAIT(N(basicAttack)) - EVT_END_IF - EVT_RETURN - EVT_END_IF - EVT_EXEC_WAIT(N(countActiveSummoners)) - EVT_SWITCH(LVar9) - EVT_CASE_EQ(1) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 300) - EVT_EXEC_WAIT(N(randomSummon)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(2) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 150) - EVT_EXEC_WAIT(N(randomSummon)) - EVT_RETURN - EVT_END_IF - EVT_CASE_EQ(3) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 100) - EVT_EXEC_WAIT(N(randomSummon)) - EVT_RETURN - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 60) - EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_DIZZY) - EVT_EXEC_WAIT(N(basicAttack)) - EVT_ELSE - EVT_EXEC_WAIT(N(sleepySpin)) - EVT_END_IF - EVT_ELSE - EVT_EXEC_WAIT(N(basicAttack)) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(randomSummon) = { - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_11) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(RandInt, 2, LVar1) - EVT_SWITCH(LVar1) - EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(80226C00)) - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(80226DEC)) - EVT_CASE_EQ(2) - EVT_EXEC_WAIT(N(802271A0)) - EVT_END_SWITCH - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_802249E0))) - EVT_RETURN - EVT_END -}; - -s32 func_8021878C_512D5C(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32 x, y, z; - f32 temp_f20; - s32 temp_v0; - - x = evt_get_variable(script, *args++); - y = evt_get_variable(script, *args++); - z = evt_get_variable(script, *args++); - temp_f20 = evt_get_float_variable(script, *args++); - temp_v0 = evt_get_variable(script, *args++); - - D_802310D0.position.x = x; - D_802310D0.position.y = y; - D_802310D0.position.z = z; - fx_46(6, &D_802310D0, temp_f20, temp_v0); - - return ApiStatus_DONE2; -} - -EvtScript N(8022671C) = { - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) - EVT_WAIT(4) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B) - EVT_WAIT(4) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) - EVT_WAIT(4) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0D) - EVT_WAIT(4) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) - EVT_WAIT(4) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B) - EVT_WAIT(4) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) - EVT_WAIT(4) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0D) - EVT_WAIT(4) - EVT_THREAD - EVT_WAIT(1) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_SETF(LVar3, EVT_FLOAT(1.0)) - EVT_ELSE - EVT_SETF(LVar3, EVT_FLOAT(0.4)) - EVT_END_IF - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(func_8021878C_512D5C, LVar0, LVar1, LVar2, LVar3, 48) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E6) - EVT_SET(LVar0, 0) - EVT_LOOP(48) - EVT_ADD(LVar0, 30) - EVT_IF_GE(LVar0, 360) - EVT_SUB(LVar0, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, LVar0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 30) - EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, LVar0, LVar1, LVar2, 30, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0A) - EVT_WAIT(8) - EVT_RETURN - EVT_END -}; - -EvtScript N(80226C00) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_EXEC_WAIT(N(8022671C)) - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802273A8)), 0) - EVT_SET(LVarB, LVar0) - EVT_SET(LVar0, 200) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 0) - EVT_CALL(SetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_03) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(SetGoalToIndex, LVarB, LVarA) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, LVarB, 0, FALSE) - EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(HPBarToHome, LVarB) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80226DEC) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_EXEC_WAIT(N(8022671C)) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_03) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802273C4)), 0) - EVT_SET(LVarB, LVar0) - EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_GrooveGuy_Anim0C) - EVT_CALL(SetGoalToIndex, LVarB, LVarA) - EVT_CALL(GetGoalPos, LVarB, LVar3, LVar4, LVar5) - EVT_ADD(LVar3, 200) - EVT_CALL(SetActorPos, LVarB, LVar3, LVar4, LVar5) - EVT_THREAD - EVT_SET(LVar6, 0) - EVT_LOOP(50) - EVT_ADD(LVar6, 30) - EVT_MOD(LVar6, 360) - EVT_CALL(SetActorYaw, LVarB, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorYaw, LVarB, 0) - EVT_END_THREAD - EVT_CALL(SetActorSounds, LVarB, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) - EVT_THREAD - EVT_LOOP(2) - EVT_CALL(PlaySoundAtActor, LVarB, SOUND_2E2) - EVT_WAIT(25) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, LVarB, 0, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20F3) - EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_GrooveGuy_Anim0A) - EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 20) - EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 30, 0) - EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) - EVT_WAIT(25) - EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_GrooveGuy_Anim01) - EVT_CALL(HPBarToHome, LVarB) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, LVarB, 0, 1) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, LVarB, 0, 2) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(802271A0) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_EXEC_WAIT(N(8022671C)) - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802273E0)), 0) - EVT_SET(LVarB, LVar0) - EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_MediGuy_Anim05) - EVT_ADD(LVarA, 4) - EVT_CALL(SetGoalToIndex, LVarB, LVarA) - EVT_CALL(GetGoalPos, LVarB, LVar3, LVar4, LVar5) - EVT_SET(LVar0, 200) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_CALL(SetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSounds, LVarB, ACTOR_SOUND_WALK, SOUND_380, SOUND_0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_03) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, LVarB, 0, FALSE) - EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_MediGuy_Anim01) - EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(HPBarToHome, LVarB) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -extern ActorBlueprint A(red_shy_guy); -extern ActorBlueprint A(medi_guy); - -Vec3i N(vector3D_8022739C) = { 0, 0xFFFFFC18, 0 }; - -Formation N(specialFormation_802273A8) = { - ACTOR_BY_POS(A(red_shy_guy), N(vector3D_8022739C), 100), -}; - -Formation N(specialFormation_802273C4) = { - ACTOR_BY_POS(NAMESPACE, N(vector3D_8022739C), 100), -}; - -Formation N(specialFormation_802273E0) = { - ACTOR_BY_POS(A(medi_guy), N(vector3D_8022739C), 100), -}; +#include "battle/common/actor/groove_guy.inc.c" diff --git a/src/battle/area/omo/actor/medi_guy.c b/src/battle/area/omo/actor/medi_guy.c index ee91037a8e..467cbb55b5 100644 --- a/src/battle/area/omo/actor/medi_guy.c +++ b/src/battle/area/omo/actor/medi_guy.c @@ -1,9 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/MediGuy.h" - -#define NAMESPACE b_area_omo_medi_guy +#include "../area.h" #include "battle/common/actor/medi_guy.inc.c" diff --git a/src/battle/area/omo/actor/pink_shy_guy.c b/src/battle/area/omo/actor/pink_shy_guy.c index a171fdf210..f9f15d1416 100644 --- a/src/battle/area/omo/actor/pink_shy_guy.c +++ b/src/battle/area/omo/actor/pink_shy_guy.c @@ -1,498 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ShyGuy.h" +#include "../area.h" -#define NAMESPACE b_area_omo_pink_shy_guy - -extern s32 N(IdleAnimations_8021E41C)[]; -extern EvtScript N(init_8021E468); -extern EvtScript N(takeTurn_8021FDB4); -extern EvtScript N(idle_8021E4B4); -extern EvtScript N(handleEvent_8021E628); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable_8021E310)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_SHOCK, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8021E324)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021E41C), - .defenseTable = N(DefenseTable_8021E310), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_SHY_GUY, - .level = 14, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021E468), - .statusTable = N(StatusTable_8021E324), - .escapeChance = 60, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 80, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 28, 24 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_8021E41C)[] = { - STATUS_KEY_NORMAL, ANIM_ShyGuy_Pink_Anim01, - STATUS_KEY_STONE, ANIM_ShyGuy_Pink_Anim00, - STATUS_KEY_SLEEP, ANIM_ShyGuy_Pink_Anim12, - STATUS_KEY_POISON, ANIM_ShyGuy_Pink_Anim01, - STATUS_KEY_STOP, ANIM_ShyGuy_Pink_Anim00, - STATUS_KEY_STATIC, ANIM_ShyGuy_Pink_Anim01, - STATUS_KEY_PARALYZE, ANIM_ShyGuy_Pink_Anim00, - STATUS_KEY_DIZZY, ANIM_ShyGuy_Pink_Anim13, - STATUS_KEY_FEAR, ANIM_ShyGuy_Pink_Anim13, - STATUS_END, -}; - -EvtScript N(init_8021E468) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021FDB4))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021E4B4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021E628))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_8021E4B4) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021E5C4) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021E628) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Pink_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Pink_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8021E5C4)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim03) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Pink_Anim14) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021EB04) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_END_THREAD - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim05) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) - EVT_WAIT(8) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(8021E5C4)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021F22C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim09) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 80) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim09) - EVT_THREAD - EVT_WAIT(12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim09) - EVT_THREAD - EVT_WAIT(9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(20) - EVT_SUB(LVar3, 30) - EVT_IF_LT(LVar3, 0) - EVT_ADD(LVar3, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim09) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim07) - EVT_WAIT(15) - EVT_GOTO(2) - EVT_LABEL(1) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim10) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 50) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim11) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim13) - EVT_END_IF - EVT_WAIT(25) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_LABEL(2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021FDB4) = { - EVT_CALL(RandInt, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_EXEC_WAIT(N(8021EB04)) - EVT_ELSE - EVT_EXEC_WAIT(N(8021F22C)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/pink_shy_guy.inc.c" diff --git a/src/battle/area/omo/actor/pyro_guy.c b/src/battle/area/omo/actor/pyro_guy.c index 17d3b02084..8fed687461 100644 --- a/src/battle/area/omo/actor/pyro_guy.c +++ b/src/battle/area/omo/actor/pyro_guy.c @@ -1,331 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/PyroGuy.h" +#include "../area.h" -#define NAMESPACE b_area_omo_pyro_guy - -extern EvtScript N(init_8022CC80); -extern EvtScript N(takeTurn_8022D344); -extern EvtScript N(idle_8022CCCC); -extern EvtScript N(handleEvent_8022CE60); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(IdleAnimations_8022CB00)[] = { - STATUS_KEY_NORMAL, ANIM_PyroGuy_Anim01, - STATUS_KEY_STONE, ANIM_PyroGuy_Anim00, - STATUS_KEY_SLEEP, ANIM_PyroGuy_Anim07, - STATUS_KEY_POISON, ANIM_PyroGuy_Anim01, - STATUS_KEY_STOP, ANIM_PyroGuy_Anim00, - STATUS_KEY_STATIC, ANIM_PyroGuy_Anim01, - STATUS_KEY_PARALYZE, ANIM_PyroGuy_Anim00, - STATUS_KEY_DIZZY, ANIM_PyroGuy_Anim08, - STATUS_KEY_FEAR, ANIM_PyroGuy_Anim08, - STATUS_END, -}; - -s32 N(DefenseTable_8022CB4C)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_WATER, -2, - ELEMENT_ICE, -2, - ELEMENT_FIRE, 99, - ELEMENT_SHOCK, 0, - ELEMENT_SMASH, 0, - ELEMENT_BLAST, -1, - ELEMENT_END, -}; - -s32 N(StatusTable_8022CB88)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 80, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts_8022CC34)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8022CB00), - .defenseTable = N(DefenseTable_8022CB4C), - .eventFlags = ACTOR_EVENT_FLAG_FIREY, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_PYRO_GUY, - .level = 15, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts_8022CC34)), - .partsData = N(ActorParts_8022CC34), - .initScript = &N(init_8022CC80), - .statusTable = N(StatusTable_8022CB88), - .escapeChance = 60, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 60, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 85, - .coinReward = 1, - .size = { 28, 36 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(init_8022CC80) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8022D344))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8022CCCC))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8022CE60))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_8022CCCC) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(8022CDDC) = { - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim04) - EVT_SET_CONST(LVar2, ANIM_PyroGuy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8022CE60) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8022CDDC)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim03) - EVT_SET_CONST(LVar2, ANIM_PyroGuy_Anim09) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_UP_AND_AWAY) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8022D344) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 70) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim05) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8022CDDC)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim05) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim01) - EVT_WAIT(8) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(8022CDDC)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/pyro_guy.inc.c" diff --git a/src/battle/area/omo/actor/red_shy_guy.c b/src/battle/area/omo/actor/red_shy_guy.c index 29b5157da7..6c887e3d95 100644 --- a/src/battle/area/omo/actor/red_shy_guy.c +++ b/src/battle/area/omo/actor/red_shy_guy.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_omo_red_shy_guy +#include "../area.h" #include "battle/common/actor/red_shy_guy.inc.c" diff --git a/src/battle/area/omo/actor/sky_guy.c b/src/battle/area/omo/actor/sky_guy.c index 695779cffa..274eee61c2 100644 --- a/src/battle/area/omo/actor/sky_guy.c +++ b/src/battle/area/omo/actor/sky_guy.c @@ -1,1013 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ShyGuy.h" -#include "sprite/npc/SkyGuy.h" +#include "../area.h" -#define NAMESPACE b_area_omo_sky_guy - -extern s32 N(IdleAnimations_8022B104)[]; -extern EvtScript N(init_8022987C); -extern EvtScript N(takeTurn_8022A9D0); -extern EvtScript N(takeTurn_8022CA9C); -extern EvtScript N(idle_80229A24); -extern EvtScript N(idle_8022B19C); -extern EvtScript N(handleEvent_8022A398); -extern EvtScript N(handleEvent_8022B310); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, - PRT_5 = 5, - PRT_6 = 6, -}; - -s32 N(IdleAnimations_802294C0)[] = { - STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim01, - STATUS_KEY_STONE, ANIM_SkyGuy_Anim00, - STATUS_KEY_SLEEP, ANIM_SkyGuy_Anim04, - STATUS_KEY_POISON, ANIM_SkyGuy_Anim01, - STATUS_KEY_STOP, ANIM_SkyGuy_Anim00, - STATUS_KEY_STATIC, ANIM_SkyGuy_Anim01, - STATUS_KEY_PARALYZE, ANIM_SkyGuy_Anim00, - STATUS_KEY_DIZZY, ANIM_SkyGuy_Anim05, - STATUS_KEY_FEAR, ANIM_SkyGuy_Anim05, - STATUS_END, -}; - -s32 N(IdleAnimations_8022950C)[] = { - STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim10, - STATUS_KEY_STONE, ANIM_SkyGuy_Anim0D, - STATUS_KEY_SLEEP, ANIM_SkyGuy_Anim19, - STATUS_KEY_POISON, ANIM_SkyGuy_Anim10, - STATUS_KEY_STOP, ANIM_SkyGuy_Anim0D, - STATUS_KEY_STATIC, ANIM_SkyGuy_Anim10, - STATUS_KEY_PARALYZE, ANIM_SkyGuy_Anim0D, - STATUS_KEY_DIZZY, ANIM_SkyGuy_Anim10, - STATUS_KEY_FEAR, ANIM_SkyGuy_Anim10, - STATUS_END, -}; - -s32 N(IdleAnimations_80229558)[] = { - STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim0F, - STATUS_KEY_STONE, ANIM_SkyGuy_Anim0C, - STATUS_KEY_SLEEP, ANIM_SkyGuy_Anim18, - STATUS_KEY_POISON, ANIM_SkyGuy_Anim0F, - STATUS_KEY_STOP, ANIM_SkyGuy_Anim0C, - STATUS_KEY_STATIC, ANIM_SkyGuy_Anim0F, - STATUS_KEY_PARALYZE, ANIM_SkyGuy_Anim0C, - STATUS_KEY_DIZZY, ANIM_SkyGuy_Anim0F, - STATUS_KEY_FEAR, ANIM_SkyGuy_Anim0F, - STATUS_END, -}; - -s32 N(IdleAnimations_802295A4)[] = { - STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim11, - STATUS_KEY_STONE, ANIM_SkyGuy_Anim0E, - STATUS_KEY_SLEEP, ANIM_SkyGuy_Anim1A, - STATUS_KEY_POISON, ANIM_SkyGuy_Anim11, - STATUS_KEY_STOP, ANIM_SkyGuy_Anim0E, - STATUS_KEY_STATIC, ANIM_SkyGuy_Anim11, - STATUS_KEY_PARALYZE, ANIM_SkyGuy_Anim0E, - STATUS_KEY_DIZZY, ANIM_SkyGuy_Anim11, - STATUS_KEY_FEAR, ANIM_SkyGuy_Anim11, - STATUS_END, -}; - -s32 N(IdleAnimations_802295F0)[] = { - STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim0B, - STATUS_END, -}; - -s32 N(DefenseTable_802295FC)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_SHOCK, 0, - ELEMENT_END, -}; - -s32 N(DefenseTable_80229610)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_SHOCK, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_80229624)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -s32 N(StatusTable_802296D0)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts_8022977C)[] = { - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 32 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8022B104), - .defenseTable = N(DefenseTable_80229610), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_802294C0), - .defenseTable = N(DefenseTable_802295FC), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 2, 50 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8022950C), - .defenseTable = N(DefenseTable_802295FC), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - .overrideNameMsg = MSG_EnemyName_Balloon, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_4, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80229558), - .defenseTable = N(DefenseTable_802295FC), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_5, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_802295A4), - .defenseTable = N(DefenseTable_802295FC), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_6, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_802295F0), - .defenseTable = N(DefenseTable_802295FC), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_FLYING, - .type = ACTOR_TYPE_SKY_GUY, - .level = 14, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts_8022977C)), - .partsData = N(ActorParts_8022977C), - .initScript = &N(init_8022987C), - .statusTable = N(StatusTable_80229624), - .escapeChance = 50, - .airLiftChance = 90, - .hurricaneChance = 90, - .spookChance = 80, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 90, - .coinReward = 1, - .size = { 28, 28 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(init_8022987C) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8022A9D0))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80229A24))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8022A398))) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_5, LVar0, LVar1, LVar2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar1, 5) - EVT_CALL(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CALL(SetPartTargetFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_TARGET_FLAG_4, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_80229A24) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(80229A34) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar2) - EVT_IF_NE(LVar2, 0) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_ELSE - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar7, LVar8, LVar9) - EVT_ADD(LVar8, 20) - EVT_PLAY_EFFECT(EFFECT_BALLOON, 2, LVar7, LVar8, LVar9, EVT_FLOAT(1.0), 150, 0) - EVT_SUB(LVar7, 14) - EVT_SUB(LVar8, 4) - EVT_PLAY_EFFECT(EFFECT_BALLOON, 0, LVar7, LVar8, LVar9, EVT_FLOAT(1.0), 150, 0) - EVT_ADD(LVar7, 28) - EVT_PLAY_EFFECT(EFFECT_BALLOON, 1, LVar7, LVar8, LVar9, EVT_FLOAT(1.0), 150, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(80229C40) = { - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim02) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_3, ANIM_SkyGuy_Anim13) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_4, ANIM_SkyGuy_Anim12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_5, ANIM_SkyGuy_Anim14) - EVT_RETURN - EVT_END -}; - -EvtScript N(80229CB0) = { - EVT_CALL(MakeLerp, 100, 80, 7, EASING_CUBIC_OUT) - EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_DIVF(LVar0, EVT_FLOAT(100.0)) - EVT_SETF(LVar2, EVT_FLOAT(2.0)) - EVT_SUBF(LVar2, LVar0) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, LVar2, LVar0, EVT_FLOAT(1.0)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, LVar2, LVar0, EVT_FLOAT(1.0)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_5, LVar2, LVar0, EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF - EVT_CALL(MakeLerp, 80, 100, 7, EASING_COS_FAST_OVERSHOOT) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_DIVF(LVar0, EVT_FLOAT(100.0)) - EVT_SETF(LVar2, EVT_FLOAT(2.0)) - EVT_SUBF(LVar2, LVar0) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, LVar2, LVar0, EVT_FLOAT(1.0)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, LVar2, LVar0, EVT_FLOAT(1.0)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_5, LVar2, LVar0, EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_5, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_RETURN - EVT_END -}; - -#include "common/StartRumbleWithParams.inc.c" - -EvtScript N(80229F08) = { - EVT_CALL(GetLastElement, LVar0) - EVT_SET(LVar0, 65536) - EVT_IF_FLAG(LVar0, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_BLAST | DAMAGE_TYPE_4000 | DAMAGE_TYPE_SPINY_SURGE) - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_THREAD - EVT_WAIT(20) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E1) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_3, ANIM_SkyGuy_Anim2E) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_4, ANIM_SkyGuy_Anim2D) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_5, ANIM_SkyGuy_Anim2F) - EVT_WAIT(30) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 2) - EVT_WAIT(15) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim00) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_263) - EVT_PLAY_EFFECT(EFFECT_EMOTE, 2, 0, LVar0, LVar1, LVar2, 24, 0, 25, 0, 0) - EVT_WAIT(25) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim06) - EVT_WAIT(30) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim06) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 120, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.5)) - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim12) - EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 3, LVar0, LVar1, LVar2, 0, 0) - EVT_WAIT(40) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8022CA9C))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8022B19C))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8022B310))) - EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_SHY_GUY) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_ELSE - EVT_EXEC_WAIT(N(80229CB0)) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8022A398) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_CALL(func_8026E914, LVar0, LVar1) - EVT_IF_GE(LVar1, 3) - EVT_EXEC_WAIT(N(80229CB0)) - EVT_ELSE - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_IF - EVT_CASE_EQ(EVENT_HIT) - EVT_CALL(func_8026E914, LVar0, LVar1) - EVT_IF_GE(LVar1, 3) - EVT_EXEC_WAIT(N(80229CB0)) - EVT_EXEC_WAIT(N(80229F08)) - EVT_ELSE - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_IF - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim09) - EVT_SET_CONST(LVar2, ANIM_SkyGuy_Anim0A) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim09) - EVT_SET_CONST(LVar2, ANIM_SkyGuy_Anim0A) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim0A) - EVT_EXEC_WAIT(N(80229A34)) - EVT_RETURN - EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_CALL(func_8026E914, LVar0, LVar1) - EVT_IF_GE(LVar1, 3) - EVT_EXEC_WAIT(N(80229CB0)) - EVT_ELSE - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_IF - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CALL(func_8026E914, LVar0, LVar1) - EVT_IF_GE(LVar1, 3) - EVT_EXEC_WAIT(N(80229CB0)) - EVT_ELSE - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim06) - EVT_EXEC_WAIT(N(80229A34)) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) - EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) - EVT_CALL(HPBarToCurrent, ACTOR_SELF) - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim03) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_LINEAR) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim01) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_3, ANIM_SkyGuy_Anim1F) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_4, ANIM_SkyGuy_Anim1E) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_5, ANIM_SkyGuy_Anim20) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim03) - EVT_SET_CONST(LVar2, ANIM_SkyGuy_Anim06) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_EXEC_WAIT(N(80229C40)) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8022A9D0) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 1) - EVT_END_IF - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E7) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim08) - EVT_WAIT(12) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 20) - EVT_ADD(LVar2, 2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_SkyGuy_Anim0B) - EVT_WAIT(12) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E8) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_6, ACTOR_SOUND_JUMP, 0, 0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(HIT_RESULT_MISS) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 120) - EVT_SET(LVar1, 0) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(12.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_EXEC_WAIT(N(80229C40)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_CASE_EQ(HIT_RESULT_LUCKY) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 50) - EVT_SET(LVar1, -5) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(14.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 30, EASING_LINEAR) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim07) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 65) - EVT_SET(LVar1, -5) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 15, EASING_LINEAR) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_EXEC_WAIT(N(80229C40)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_SWITCH - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(14.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 15, EASING_LINEAR) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, DAMAGE_TYPE_NO_CONTACT, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVarF) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 55) - EVT_SET(LVar1, 0) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(4.0)) - EVT_SUB(LVar0, 20) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_EXEC_WAIT(N(80229C40)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -s32 N(IdleAnimations_8022B104)[] = { - STATUS_KEY_NORMAL, ANIM_ShyGuy_Red_Anim01, - STATUS_KEY_STONE, ANIM_ShyGuy_Red_Anim00, - STATUS_KEY_SLEEP, ANIM_ShyGuy_Red_Anim12, - STATUS_KEY_POISON, ANIM_ShyGuy_Red_Anim01, - STATUS_KEY_STOP, ANIM_ShyGuy_Red_Anim00, - STATUS_KEY_STATIC, ANIM_ShyGuy_Red_Anim01, - STATUS_KEY_PARALYZE, ANIM_ShyGuy_Red_Anim00, - STATUS_KEY_DIZZY, ANIM_ShyGuy_Red_Anim13, - STATUS_KEY_FEAR, ANIM_ShyGuy_Red_Anim13, - STATUS_END, -}; - -EvtScript N(8022B150) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8022CA9C))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8022B19C))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8022B310))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_8022B19C) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(8022B2AC) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8022B310) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8022B2AC)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim14) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8022B7EC) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_END_THREAD - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_WAIT(8) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(8022B2AC)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8022BF14) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 80) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) - EVT_THREAD - EVT_WAIT(12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) - EVT_THREAD - EVT_WAIT(9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(20) - EVT_SUB(LVar3, 30) - EVT_IF_LT(LVar3, 0) - EVT_ADD(LVar3, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim07) - EVT_WAIT(15) - EVT_GOTO(2) - EVT_LABEL(1) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim10) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 50) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim11) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim13) - EVT_END_IF - EVT_WAIT(25) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_LABEL(2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8022CA9C) = { - EVT_CALL(RandInt, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_EXEC_WAIT(N(8022B7EC)) - EVT_ELSE - EVT_EXEC_WAIT(N(8022BF14)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/sky_guy.inc.c" diff --git a/src/battle/area/omo/actor/spy_guy.c b/src/battle/area/omo/actor/spy_guy.c index ffc76229e2..9cf5b231d1 100644 --- a/src/battle/area/omo/actor/spy_guy.c +++ b/src/battle/area/omo/actor/spy_guy.c @@ -1,623 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/SpyGuy.h" +#include "../area.h" -#define NAMESPACE b_area_omo_spy_guy - -extern EvtScript N(init_802275D4); -extern EvtScript N(takeTurn_802293DC); -extern EvtScript N(idle_802276C4); -extern EvtScript N(handleEvent_80227ABC); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, -}; - -s32 N(IdleAnimations_80227400)[] = { - STATUS_KEY_NORMAL, ANIM_SpyGuy_Anim03, - STATUS_KEY_STONE, ANIM_SpyGuy_Anim01, - STATUS_KEY_SLEEP, ANIM_SpyGuy_Anim0F, - STATUS_KEY_POISON, ANIM_SpyGuy_Anim03, - STATUS_KEY_STOP, ANIM_SpyGuy_Anim01, - STATUS_KEY_STATIC, ANIM_SpyGuy_Anim03, - STATUS_KEY_PARALYZE, ANIM_SpyGuy_Anim01, - STATUS_KEY_DIZZY, ANIM_SpyGuy_Anim12, - STATUS_KEY_FEAR, ANIM_SpyGuy_Anim12, - STATUS_END, -}; - -s32 N(IdleAnimations_8022744C)[] = { - STATUS_KEY_NORMAL, ANIM_SpyGuy_Anim02, - STATUS_KEY_STONE, ANIM_SpyGuy_Anim00, - STATUS_KEY_SLEEP, ANIM_SpyGuy_Anim0F, - STATUS_KEY_POISON, ANIM_SpyGuy_Anim02, - STATUS_KEY_STOP, ANIM_SpyGuy_Anim00, - STATUS_KEY_STATIC, ANIM_SpyGuy_Anim02, - STATUS_KEY_PARALYZE, ANIM_SpyGuy_Anim00, - STATUS_KEY_DIZZY, ANIM_SpyGuy_Anim12, - STATUS_KEY_FEAR, ANIM_SpyGuy_Anim12, - STATUS_END, -}; - -s32 N(IdleAnimations_80227498)[] = { - STATUS_KEY_NORMAL, ANIM_SpyGuy_Anim10, - STATUS_END, -}; - -s32 N(DefenseTable_802274A4)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_SHOCK, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_802274B8)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 80, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts_80227564)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 30 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80227400), - .defenseTable = N(DefenseTable_802274A4), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -13 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_80227498), - .defenseTable = N(DefenseTable_802274A4), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_SPY_GUY, - .level = 15, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts_80227564)), - .partsData = N(ActorParts_80227564), - .initScript = &N(init_802275D4), - .statusTable = N(StatusTable_802274B8), - .escapeChance = 50, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 60, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 85, - .coinReward = 1, - .size = { 32, 32 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(init_802275D4) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_802293DC))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_802276C4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80227ABC))) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0) - EVT_CALL(GetInstigatorValue, ACTOR_SELF, LVar0) - EVT_IF_NE(LVar0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8022744C))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim02) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_802276C4) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(802276D4) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim02) - EVT_CASE_EQ(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) - EVT_END_SWITCH - EVT_LABEL(0) - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_100) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80227400))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim17) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim19) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8022744C))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim18) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim1A) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim02) - EVT_END_SWITCH - EVT_WAIT(10) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_80227ABC) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 1) - EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 1) - EVT_EXEC_WAIT(N(802276D4)) - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0D) - EVT_SET_CONST(LVar2, ANIM_SpyGuy_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 1) - EVT_EXEC_WAIT(N(802276D4)) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0D) - EVT_SET_CONST(LVar2, ANIM_SpyGuy_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CALL(SetActorVar, ACTOR_SELF, 3, 1) - EVT_EXEC_WAIT(N(802276D4)) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) - EVT_IF_EQ(LVar1, 0) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim02) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim03) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) - EVT_IF_EQ(LVar1, 0) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim02) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim03) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_EXEC_WAIT(N(802276D4)) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) - EVT_IF_EQ(LVar1, 0) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim02) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim03) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) - EVT_IF_EQ(LVar1, 0) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim06) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) - EVT_END_IF - EVT_SET_CONST(LVar2, ANIM_SpyGuy_Anim11) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) - EVT_IF_EQ(LVar1, 0) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim06) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) - EVT_IF_EQ(LVar1, 0) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim06) - EVT_ELSE - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(slingshotAttack) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 1) - EVT_END_IF - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E7) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim15) - EVT_WAIT(12) - EVT_WAIT(12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_ADD(LVar1, 10) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) - EVT_END_IF - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E8) - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_THREAD - EVT_LOOP(0) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_2, LVar3, LVar4, LVar5) - EVT_IF_GT(LVar0, LVar3) - EVT_BREAK_LOOP - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_END_THREAD - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, -100, 0, 0) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_2, EVT_FLOAT(14.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(0.002)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, 0, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(YieldTurn) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_WAIT(15) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_2, EVT_FLOAT(14.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(0.002)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, 0, TRUE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 100) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(0.7)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 30, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(YieldTurn) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/ItemEntityJumpToPos.inc.c" - -#include "common/GetItemEntityPosition.inc.c" - -#include "common/DisableRandomAbility.inc.c" - -#include "common/SpyGuyActionFunc.inc.c" - -#include "common/StartRumbleWithParams.inc.c" - -EvtScript N(80228778) = { - EVT_LABEL(0) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_SWITCH(LVarA) - EVT_CASE_EQ(0) - EVT_CASE_EQ(1) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar1, LVar2, LVar3) - EVT_SET(LVar2, 0) - EVT_SUB(LVar3, 1) - EVT_CALL(N(DisableRandomAbility), LVar4, LVar5) - EVT_CALL(MakeItemEntity, LVar4, LVar1, LVar2, LVar3, ITEM_SPAWN_MODE_DECORATION, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, LVar0) - EVT_ADD(LVar1, 30) - EVT_CALL(N(ItemEntityJumpToPos), LVar0, LVar1, LVar2, LVar3, 20, EVT_FLOAT(1.0)) - EVT_ADD(LVar1, 20) - EVT_CALL(N(ItemEntityJumpToPos), LVar0, LVar1, LVar2, LVar3, 10, EVT_FLOAT(1.0)) - EVT_ADD(LVar1, 10) - EVT_CALL(N(ItemEntityJumpToPos), LVar0, LVar1, LVar2, LVar3, 5, EVT_FLOAT(1.0)) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CASE_EQ(2) - EVT_CALL(ShowMessageBox, LVar5, 60) - EVT_SUB(LVar1, 150) - EVT_CALL(N(ItemEntityJumpToPos), LVar0, LVar1, LVar2, LVar3, 30, EVT_FLOAT(1.0)) - EVT_CALL(RemoveItemEntity, LVar0) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 3) - EVT_RETURN - EVT_END_SWITCH - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(hammerAttack) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 70, 0, 0) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_NOT_FLAG(LVar1, STATUS_FLAG_SHRINK) - EVT_CALL(AddGoalPos, ACTOR_SELF, 20, 0, 0) - EVT_END_IF - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) - EVT_WAIT(10) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_THREAD - EVT_WAIT(4) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_327) - EVT_END_THREAD - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim0A) - EVT_WAIT(6) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim0A) - EVT_WAIT(5) - EVT_WAIT(2) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_SET(LFlag0, FALSE) - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) - EVT_CALL(N(SpyGuyActionFunc), LVar0) - EVT_IF_NE(LVar0, -1) - EVT_SET(LFlag0, TRUE) - EVT_END_IF - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_LE(LVar0, 0) - EVT_WAIT(20) - EVT_GOTO(100) - EVT_END_IF - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAG_SHRINK) - EVT_WAIT(20) - EVT_GOTO(100) - EVT_END_IF - EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAG_STONE | STATUS_FLAG_RIGHT_ON) - EVT_WAIT(20) - EVT_GOTO(100) - EVT_END_IF - EVT_IF_EQ(LFlag0, TRUE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_EXEC(N(80228778)) - EVT_WAIT(8) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 70) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) - EVT_LABEL(0) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_IF_NE(LVar0, 0) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_CALL(N(GetItemEntityPosition), LVar0, LVar1, LVar2, LVar3) - EVT_ADD(LVar1, 20) - EVT_SUB(LVar3, 2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_THREAD - EVT_WAIT(5) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DC) - EVT_CALL(N(StartRumbleWithParams), 200, 10) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim09) - EVT_WAIT(5) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 2) - EVT_SUB(LVar1, 7) - EVT_PLAY_EFFECT(EFFECT_FIREWORK, 0, LVar1, LVar2, LVar3, EVT_FLOAT(1.0), 0, 0) - EVT_WAIT(40) - EVT_ELSE - EVT_WAIT(8) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 70) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) - EVT_WAIT(10) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 10) - EVT_PLAY_EFFECT(EFFECT_EMOTE, 2, 0, LVar0, LVar1, LVar2, 25, -45, 20, 0, 0) - EVT_WAIT(20) - EVT_END_IF - EVT_LABEL(100) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_802293DC) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8022744C))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim02) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(slingshotAttack)) - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(hammerAttack)) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/spy_guy.inc.c" diff --git a/src/battle/area/omo/actor/yellow_shy_guy.c b/src/battle/area/omo/actor/yellow_shy_guy.c index a8f2d3ec5d..24f8df6cd3 100644 --- a/src/battle/area/omo/actor/yellow_shy_guy.c +++ b/src/battle/area/omo/actor/yellow_shy_guy.c @@ -1,499 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ShyGuy.h" +#include "../area.h" -#define NAMESPACE b_area_omo_yellow_shy_guy - -extern s32 N(IdleAnimations_8021C91C)[]; -extern EvtScript N(init_8021C968); -extern EvtScript N(takeTurn_8021E2B4); -extern EvtScript N(idle_8021C9B4); -extern EvtScript N(handleEvent_8021CB28); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, -}; - -s32 N(DefenseTable_8021C810)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_SHOCK, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_8021C824)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 50, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 50, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_8021C91C), - .defenseTable = N(DefenseTable_8021C810), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -1, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_SHY_GUY, - .level = 14, - .maxHP = 7, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init_8021C968), - .statusTable = N(StatusTable_8021C824), - .escapeChance = 60, - .airLiftChance = 85, - .hurricaneChance = 80, - .spookChance = 80, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 28, 24 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations_8021C91C)[] = { - STATUS_KEY_NORMAL, ANIM_ShyGuy_Yellow_Anim01, - STATUS_KEY_STONE, ANIM_ShyGuy_Yellow_Anim00, - STATUS_KEY_SLEEP, ANIM_ShyGuy_Yellow_Anim12, - STATUS_KEY_POISON, ANIM_ShyGuy_Yellow_Anim01, - STATUS_KEY_STOP, ANIM_ShyGuy_Yellow_Anim00, - STATUS_KEY_STATIC, ANIM_ShyGuy_Yellow_Anim01, - STATUS_KEY_PARALYZE, ANIM_ShyGuy_Yellow_Anim00, - STATUS_KEY_DIZZY, ANIM_ShyGuy_Yellow_Anim13, - STATUS_KEY_FEAR, ANIM_ShyGuy_Yellow_Anim13, - STATUS_END, -}; - -EvtScript N(init_8021C968) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021E2B4))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C9B4))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021CB28))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle_8021C9B4) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021CAC4) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021CB28) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Yellow_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0D) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Yellow_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(8021CAC4)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim03) - EVT_SET_CONST(LVar2, ANIM_ShyGuy_Yellow_Anim14) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021D004) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 50) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) - EVT_END_THREAD - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim04) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim05) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 30) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) - EVT_WAIT(8) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(8021CAC4)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(8021D72C) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(MoveBattleCamOver, 20) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim09) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 80) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim04) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_SUB(LVar0, 40) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim09) - EVT_THREAD - EVT_WAIT(12) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim05) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_SUB(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim09) - EVT_THREAD - EVT_WAIT(9) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim0A) - EVT_END_THREAD - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(MoveBattleCamOver, 15) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) - EVT_SET(LVar3, 0) - EVT_LOOP(20) - EVT_SUB(LVar3, 30) - EVT_IF_LT(LVar3, 0) - EVT_ADD(LVar3, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_END_THREAD - EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim09) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim07) - EVT_WAIT(15) - EVT_GOTO(2) - EVT_LABEL(1) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim10) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(RandInt, 100, LVar0) - EVT_IF_LT(LVar0, 50) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim11) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim13) - EVT_END_IF - EVT_WAIT(25) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_LABEL(2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim04) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_8021E2B4) = { - EVT_CALL(RandInt, 1, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_EXEC_WAIT(N(8021D004)) - EVT_ELSE - EVT_EXEC_WAIT(N(8021D72C)) - EVT_END_IF - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/yellow_shy_guy.inc.c" diff --git a/src/battle/area/omo/area.c b/src/battle/area/omo/area.c index 43d3498018..1de3b003a1 100644 --- a/src/battle/area/omo/area.c +++ b/src/battle/area/omo/area.c @@ -1,352 +1,348 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "area.h" -#define NAMESPACE b_area_omo +extern ActorBlueprint A(red_shy_guy); +extern ActorBlueprint A(blue_shy_guy); +extern ActorBlueprint A(yellow_shy_guy); +extern ActorBlueprint A(pink_shy_guy); +extern ActorBlueprint A(green_shy_guy); +extern ActorBlueprint A(anti_guy); +extern ActorBlueprint A(medi_guy); +extern ActorBlueprint A(groove_guy); +extern ActorBlueprint A(spy_guy); +extern ActorBlueprint A(sky_guy); +extern ActorBlueprint A(pyro_guy); -extern ActorBlueprint N(red_shy_guy); -extern ActorBlueprint N(blue_shy_guy); -extern ActorBlueprint N(yellow_shy_guy); -extern ActorBlueprint N(pink_shy_guy); -extern ActorBlueprint N(green_shy_guy); -extern ActorBlueprint N(anti_guy); -extern ActorBlueprint N(medi_guy); -extern ActorBlueprint N(groove_guy); -extern ActorBlueprint N(spy_guy); -extern ActorBlueprint N(sky_guy); -extern ActorBlueprint N(pyro_guy); +extern Stage A(omo_01); +extern Stage A(omo_02); +extern Stage A(omo_03); +extern Stage A(omo_03b); +extern Stage A(omo_04); +extern Stage A(omo_05); +extern Stage A(omo_05b); +extern Stage A(omo_06); +extern Stage A(omo_07); -extern Stage N(omo_01); -extern Stage N(omo_02); -extern Stage N(omo_03); -extern Stage N(omo_03b); -extern Stage N(omo_04); -extern Stage N(omo_05); -extern Stage N(omo_05b); -extern Stage N(omo_06); -extern Stage N(omo_07); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(red_shy_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(red_shy_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(red_shy_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(red_shy_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(blue_shy_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(blue_shy_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(blue_shy_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(blue_shy_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(yellow_shy_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(yellow_shy_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(yellow_shy_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(yellow_shy_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(yellow_shy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(yellow_shy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(yellow_shy_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(yellow_shy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(yellow_shy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(yellow_shy_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(pink_shy_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(pink_shy_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(pink_shy_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(pink_shy_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(green_shy_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(green_shy_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(green_shy_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(green_shy_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(red_shy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(red_shy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(blue_shy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(blue_shy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(yellow_shy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(yellow_shy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(yellow_shy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(green_shy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(red_shy_guy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(blue_shy_guy), BTL_POS_GROUND_D, 7), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(yellow_shy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(green_shy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(red_shy_guy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(blue_shy_guy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(pink_shy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(pink_shy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(pink_shy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_D, 7), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(pink_shy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_D, 7), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(green_shy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(green_shy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_C, 9), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_C, 9), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(yellow_shy_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(yellow_shy_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(yellow_shy_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(yellow_shy_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 9), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 9), }; -Formation N(Formation_11) = { - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_11) = { + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_12) = { - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(green_shy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_12) = { + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(green_shy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_13) = { - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(green_shy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_D, 7), +Formation A(Formation_13) = { + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(green_shy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_D, 7), }; -Formation N(Formation_14) = { - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_14) = { + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_15) = { - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_15) = { + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_16) = { - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_16) = { + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_17) = { - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 9), +Formation A(Formation_17) = { + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 9), }; -Formation N(Formation_18) = { - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_18) = { + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_19) = { - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_D, 7), +Formation A(Formation_19) = { + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_D, 7), }; -Formation N(Formation_1A) = { - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_D, 7), +Formation A(Formation_1A) = { + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_1B) = { - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_D, 7), +Formation A(Formation_1B) = { + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_D, 7), }; -Formation N(Formation_1C) = { - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_1C) = { + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_1D) = { - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_1D) = { + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_1E) = { - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 9), +Formation A(Formation_1E) = { + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 9), }; -Formation N(Formation_1F) = { - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_1F) = { + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_20) = { - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_D, 7), +Formation A(Formation_20) = { + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_D, 7), }; -Formation N(Formation_21) = { - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_21) = { + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_22) = { - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_22) = { + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_23) = { - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_D, 7), +Formation A(Formation_23) = { + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_D, 7), }; -Formation N(Formation_24) = { - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spy_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_24) = { + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spy_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_25) = { - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_C, 9), +Formation A(Formation_25) = { + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_26) = { - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_26) = { + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_27) = { - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_27) = { + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_28) = { - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_28) = { + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_29) = { - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(medi_guy), BTL_POS_AIR_D, 7), +Formation A(Formation_29) = { + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(medi_guy), BTL_POS_AIR_D, 7), }; -Formation N(Formation_2A) = { - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(pyro_guy), BTL_POS_GROUND_C, 8), +Formation A(Formation_2A) = { + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(pyro_guy), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_2B) = { - ACTOR_BY_IDX(N(groove_guy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(blue_shy_guy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(sky_guy), BTL_POS_AIR_C, 8), +Formation A(Formation_2B) = { + ACTOR_BY_IDX(A(groove_guy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(blue_shy_guy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(sky_guy), BTL_POS_AIR_C, 8), }; -Formation N(Formation_2C) = { - ACTOR_BY_IDX(N(anti_guy), BTL_POS_GROUND_B, 10), +Formation A(Formation_2C) = { + ACTOR_BY_IDX(A(anti_guy), BTL_POS_GROUND_B, 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(omo_04), "あかx2"), - BATTLE(N(Formation_01), N(omo_04), "あおx2"), - BATTLE(N(Formation_02), N(omo_04), "きいろx2"), - BATTLE(N(Formation_03), N(omo_04), "きいろx3"), - BATTLE(N(Formation_04), N(omo_04), "ももx2"), - BATTLE(N(Formation_05), N(omo_04), "みどりx2"), - BATTLE(N(Formation_06), N(omo_04), "あか,かいふくx2"), - BATTLE(N(Formation_07), N(omo_04), "あお,ダンシング,かいふく"), - BATTLE(N(Formation_08), N(omo_04), "きいろ,コマンド,かいふく"), - BATTLE(N(Formation_09), N(omo_04), "きいろ,みどり,あか,あお"), - BATTLE(N(Formation_0A), N(omo_04), "もも,ファイア,かいふく"), - BATTLE(N(Formation_0B), N(omo_04), "もも,ダンシング,かいふくx2"), - BATTLE(N(Formation_0C), N(omo_04), "みどり,バルーン,かいふく"), - BATTLE(N(Formation_0D), N(omo_04), "バルーンx2"), - BATTLE(N(Formation_0E), N(omo_04), "バルーン,きいろ"), - BATTLE(N(Formation_0F), N(omo_04), "バルーンx2,きいろ"), - BATTLE(N(Formation_10), N(omo_04), "バルーン,かいふく"), - BATTLE(N(Formation_11), N(omo_04), "バルーンx2,コマンド"), - BATTLE(N(Formation_12), N(omo_04), "バルーン,みどり,かいふく"), - BATTLE(N(Formation_13), N(omo_04), "バルーン,みどり,かいふくx2"), - BATTLE(N(Formation_14), N(omo_04), "バルーン,ダンシング,かいふく"), - BATTLE(N(Formation_15), N(omo_04), "コマンドx2"), - BATTLE(N(Formation_16), N(omo_04), "コマンド,ファイア"), - BATTLE(N(Formation_17), N(omo_04), "コマンド,かいふく"), - BATTLE(N(Formation_18), N(omo_04), "コマンドx2,かいふく"), - BATTLE(N(Formation_19), N(omo_04), "コマンドx3,かいふく"), - BATTLE(N(Formation_1A), N(omo_04), "コマンドx4"), - BATTLE(N(Formation_1B), N(omo_04), "コマンド,ファイア,ダンシング,かいふく"), - BATTLE(N(Formation_1C), N(omo_04), "ファイアx2"), - BATTLE(N(Formation_1D), N(omo_04), "ファイアx3"), - BATTLE(N(Formation_1E), N(omo_04), "ファイア,かいふく"), - BATTLE(N(Formation_1F), N(omo_04), "ファイアx2,かいふく"), - BATTLE(N(Formation_20), N(omo_04), "ファイアx2,かいふくx2"), - BATTLE(N(Formation_21), N(omo_04), "ファイア,ダンシング,ファイア"), - BATTLE(N(Formation_22), N(omo_04), "ファイア,コマンド,ダンシング"), - BATTLE(N(Formation_23), N(omo_04), "ファイア,ダンシング,かいふくx2"), - BATTLE(N(Formation_24), N(omo_04), "ファイアx2,コマンド"), - BATTLE(N(Formation_25), N(omo_04), "ダンシングx2"), - BATTLE(N(Formation_26), N(omo_04), "ダンシングx3"), - BATTLE(N(Formation_27), N(omo_04), "ダンシング,かいふくx2"), - BATTLE(N(Formation_28), N(omo_04), "ダンシングx2,かいふく"), - BATTLE(N(Formation_29), N(omo_04), "ダンシングx2,かいふくx2"), - BATTLE(N(Formation_2A), N(omo_04), "ダンシングx2,ファイアー"), - BATTLE(N(Formation_2B), N(omo_04), "ダンシング,あお,バルーン"), - BATTLE(N(Formation_2C), N(omo_04), "ブラック"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(omo_04), "あかx2"), + BATTLE(A(Formation_01), A(omo_04), "あおx2"), + BATTLE(A(Formation_02), A(omo_04), "きいろx2"), + BATTLE(A(Formation_03), A(omo_04), "きいろx3"), + BATTLE(A(Formation_04), A(omo_04), "ももx2"), + BATTLE(A(Formation_05), A(omo_04), "みどりx2"), + BATTLE(A(Formation_06), A(omo_04), "あか,かいふくx2"), + BATTLE(A(Formation_07), A(omo_04), "あお,ダンシング,かいふく"), + BATTLE(A(Formation_08), A(omo_04), "きいろ,コマンド,かいふく"), + BATTLE(A(Formation_09), A(omo_04), "きいろ,みどり,あか,あお"), + BATTLE(A(Formation_0A), A(omo_04), "もも,ファイア,かいふく"), + BATTLE(A(Formation_0B), A(omo_04), "もも,ダンシング,かいふくx2"), + BATTLE(A(Formation_0C), A(omo_04), "みどり,バルーン,かいふく"), + BATTLE(A(Formation_0D), A(omo_04), "バルーンx2"), + BATTLE(A(Formation_0E), A(omo_04), "バルーン,きいろ"), + BATTLE(A(Formation_0F), A(omo_04), "バルーンx2,きいろ"), + BATTLE(A(Formation_10), A(omo_04), "バルーン,かいふく"), + BATTLE(A(Formation_11), A(omo_04), "バルーンx2,コマンド"), + BATTLE(A(Formation_12), A(omo_04), "バルーン,みどり,かいふく"), + BATTLE(A(Formation_13), A(omo_04), "バルーン,みどり,かいふくx2"), + BATTLE(A(Formation_14), A(omo_04), "バルーン,ダンシング,かいふく"), + BATTLE(A(Formation_15), A(omo_04), "コマンドx2"), + BATTLE(A(Formation_16), A(omo_04), "コマンド,ファイア"), + BATTLE(A(Formation_17), A(omo_04), "コマンド,かいふく"), + BATTLE(A(Formation_18), A(omo_04), "コマンドx2,かいふく"), + BATTLE(A(Formation_19), A(omo_04), "コマンドx3,かいふく"), + BATTLE(A(Formation_1A), A(omo_04), "コマンドx4"), + BATTLE(A(Formation_1B), A(omo_04), "コマンド,ファイア,ダンシング,かいふく"), + BATTLE(A(Formation_1C), A(omo_04), "ファイアx2"), + BATTLE(A(Formation_1D), A(omo_04), "ファイアx3"), + BATTLE(A(Formation_1E), A(omo_04), "ファイア,かいふく"), + BATTLE(A(Formation_1F), A(omo_04), "ファイアx2,かいふく"), + BATTLE(A(Formation_20), A(omo_04), "ファイアx2,かいふくx2"), + BATTLE(A(Formation_21), A(omo_04), "ファイア,ダンシング,ファイア"), + BATTLE(A(Formation_22), A(omo_04), "ファイア,コマンド,ダンシング"), + BATTLE(A(Formation_23), A(omo_04), "ファイア,ダンシング,かいふくx2"), + BATTLE(A(Formation_24), A(omo_04), "ファイアx2,コマンド"), + BATTLE(A(Formation_25), A(omo_04), "ダンシングx2"), + BATTLE(A(Formation_26), A(omo_04), "ダンシングx3"), + BATTLE(A(Formation_27), A(omo_04), "ダンシング,かいふくx2"), + BATTLE(A(Formation_28), A(omo_04), "ダンシングx2,かいふく"), + BATTLE(A(Formation_29), A(omo_04), "ダンシングx2,かいふくx2"), + BATTLE(A(Formation_2A), A(omo_04), "ダンシングx2,ファイアー"), + BATTLE(A(Formation_2B), A(omo_04), "ダンシング,あお,バルーン"), + BATTLE(A(Formation_2C), A(omo_04), "ブラック"), {}, }; -StageList N(Stages) = { - STAGE("omo_01", N(omo_01)), - STAGE("omo_02", N(omo_02)), - STAGE("omo_03", N(omo_03)), - STAGE("omo_03b", N(omo_03b)), - STAGE("omo_04", N(omo_04)), - STAGE("omo_05", N(omo_05)), - STAGE("omo_05b", N(omo_05b)), - STAGE("omo_06", N(omo_06)), - STAGE("omo_07", N(omo_07)), +StageList A(Stages) = { + STAGE("omo_01", A(omo_01)), + STAGE("omo_02", A(omo_02)), + STAGE("omo_03", A(omo_03)), + STAGE("omo_03b", A(omo_03b)), + STAGE("omo_04", A(omo_04)), + STAGE("omo_05", A(omo_05)), + STAGE("omo_05b", A(omo_05b)), + STAGE("omo_06", A(omo_06)), + STAGE("omo_07", A(omo_07)), {}, }; diff --git a/src/battle/area/omo/area.h b/src/battle/area/omo/area.h new file mode 100644 index 0000000000..f22361cce7 --- /dev/null +++ b/src/battle/area/omo/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_omo diff --git a/src/battle/area/omo/stage/omo_01.c b/src/battle/area/omo/stage/omo_01.c index 96c3e9bd55..39cffd919b 100644 --- a/src/battle/area/omo/stage/omo_01.c +++ b/src/battle/area/omo/stage/omo_01.c @@ -1,103 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/omo_bt01_shape.h" -#include "model.h" +#include "../area.h" -#define NAMESPACE b_area_omo_omo_01 - -extern EvtScript N(updateModels); - -s32 N(modelList)[] = { MODEL_uma }; - -typedef struct Omo01Struct { - /* 0x00 */ f32 offsetX; - /* 0x04 */ f32 offsetZ; - /* 0x08 */ f32 rotSpeed; - /* 0x0C */ f32 angle; - /* 0x10 */ s32 modelID; - /* 0x14 */ s32 unk_14; -} Omo01Struct; // size = 0x18 - -API_CALLABLE(N(update_model_uma)) { - Omo01Struct* ptr; - Model* model; - f32 rotZ; - f32 offsetY; - s32 i; - Matrix4f mtx1; - Matrix4f mtx2; - - if (isInitialCall) { - ptr = heap_malloc(sizeof(*ptr)); - script->functionTempPtr[0] = ptr; - - for (i = 0; i == 0; i++, ptr++) { - ptr->modelID = N(modelList)[i]; - ptr->unk_14 = ((s32*)N(updateModels))[i]; // WTF ??? - model = get_model_from_list_index(get_model_list_index_from_tree_index(ptr->modelID)); - ptr->offsetX = 0.0f; - ptr->offsetZ = 0.0f; - ptr->rotSpeed = 3.5f; - ptr->angle = 0.0f; - } - } - - ptr = script->functionTempPtr[0]; - for (i = 0; i == 0; i++, ptr++) { - ptr->angle += ptr->rotSpeed; - ptr->angle = clamp_angle(ptr->angle); - - rotZ = sin_rad(ptr->angle * 3.14f / 180.0f) * 20.0f; // the value of PI xD - offsetY = SQ(rotZ) / 90.0f; - - model = get_model_from_list_index(get_model_list_index_from_tree_index(ptr->modelID)); - model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED; - guTranslateF(mtx1, -ptr->offsetX, 0.0f, -ptr->offsetZ); - guRotateF(mtx2, rotZ, 0.0f, 0.0f, 1.0f); - guMtxCatF(mtx1, mtx2, model->transformMatrix); - guTranslateF(mtx1, ptr->offsetX, offsetY, ptr->offsetZ); - guMtxCatF(model->transformMatrix, mtx1, model->transformMatrix); - } - return ApiStatus_BLOCK; -} - -EvtScript N(updateModels) = { - EVT_CALL(N(update_model_uma)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SETF(LVar0, EVT_FLOAT(0.0)) - EVT_SETF(LVar1, EVT_FLOAT(0.0)) - EVT_LOOP(0) - EVT_CALL(RotateModel, MODEL_o367, LVar1, 0, 0, 1) - EVT_CALL(RotateModel, MODEL_hari, LVar0, 0, 0, 1) - EVT_SUBF(LVar0, EVT_FLOAT(0.6)) - EVT_SUBF(LVar1, EVT_FLOAT(7.2)) - EVT_CALL(ClampAngleFloat, LVar0) - EVT_CALL(ClampAngleFloat, LVar1) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_EXEC(N(updateModels)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt01_shape", - .hit = "omo_bt01_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_01.inc.c" diff --git a/src/battle/area/omo/stage/omo_02.c b/src/battle/area/omo/stage/omo_02.c index 3984d5a52f..913b803ea0 100644 --- a/src/battle/area/omo/stage/omo_02.c +++ b/src/battle/area/omo/stage/omo_02.c @@ -1,25 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_omo_omo_02 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt02_shape", - .hit = "omo_bt02_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_02.inc.c" diff --git a/src/battle/area/omo/stage/omo_03.c b/src/battle/area/omo/stage/omo_03.c index 466839fee7..b2f2c85d1b 100644 --- a/src/battle/area/omo/stage/omo_03.c +++ b/src/battle/area/omo/stage/omo_03.c @@ -1,26 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_omo_omo_03 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 18, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt03_shape", - .hit = "omo_bt03_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_03.inc.c" diff --git a/src/battle/area/omo/stage/omo_03b.c b/src/battle/area/omo/stage/omo_03b.c index 09c58a30ca..3c65efc08f 100644 --- a/src/battle/area/omo/stage/omo_03b.c +++ b/src/battle/area/omo/stage/omo_03b.c @@ -1,25 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_omo_omo_03b - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt03_shape", - .hit = "omo_bt03_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_03b.inc.c" diff --git a/src/battle/area/omo/stage/omo_04.c b/src/battle/area/omo/stage/omo_04.c index 86f7551b28..337743fdfa 100644 --- a/src/battle/area/omo/stage/omo_04.c +++ b/src/battle/area/omo/stage/omo_04.c @@ -1,64 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/omo_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_omo_omo_04 - -extern Formation N(fromation_slot_machine); -extern ActorBlueprint N(slot_machine_stop); -extern ActorBlueprint N(slot_machine_start); - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetTexPanner, 29, TEX_PANNER_A) - EVT_THREAD - EVT_SET(LVarE, 0) - EVT_LOOP(0) - EVT_ADD(LVarE, 32768) - EVT_CALL(SetTexPanOffset, TEX_PANNER_A, TEX_PANNER_MAIN, LVarE, 0) - EVT_WAIT(10) - EVT_END_LOOP - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_itigo, - MODEL_kisya, - MODEL_kusari, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt04_shape", - .hit = "omo_bt04_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), - .stageEnemyCount = 4, - .stageFormation = &N(fromation_slot_machine), -}; - -Vec3i N(slot_machine_pos1) = { -49, 56, -68 }; -Vec3i N(slot_machine_pos2) = { -13, 56, -68 }; -Vec3i N(slot_machine_pos3) = { 20, 56, -68 }; -Vec3i N(slot_machine_pos4) = { 53, 56, -68 }; - -Formation N(fromation_slot_machine) = { - ACTOR_BY_POS(N(slot_machine_start), N(slot_machine_pos1), 0, 0), - ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos2), 0, 1), - ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos3), 0, 2), - ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos4), 0, 3), -}; - -#include "battle/common/actor/slot_machine.inc.c" +#include "battle/common/stage/area_omo/omo_04.inc.c" diff --git a/src/battle/area/omo/stage/omo_05.c b/src/battle/area/omo/stage/omo_05.c index a5c4daf47f..5bb7fee6d7 100644 --- a/src/battle/area/omo/stage/omo_05.c +++ b/src/battle/area/omo/stage/omo_05.c @@ -1,35 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/omo_bt05_shape.h" +#include "../area.h" -#define NAMESPACE b_area_omo_omo_05 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 24, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 28, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_itigo, - MODEL_kisya, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt05_shape", - .hit = "omo_bt05_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_omo/omo_05.inc.c" diff --git a/src/battle/area/omo/stage/omo_05b.c b/src/battle/area/omo/stage/omo_05b.c index 14ea521017..7c4199ba40 100644 --- a/src/battle/area/omo/stage/omo_05b.c +++ b/src/battle/area/omo/stage/omo_05b.c @@ -1,34 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/omo_bt05_shape.h" +#include "../area.h" -#define NAMESPACE b_area_omo_omo_05b - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 35, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 45, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_mae2, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt05_shape", - .hit = "omo_bt05_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_omo/omo_05b.inc.c" diff --git a/src/battle/area/omo/stage/omo_06.c b/src/battle/area/omo/stage/omo_06.c index 7af5edb72c..80de44f78b 100644 --- a/src/battle/area/omo/stage/omo_06.c +++ b/src/battle/area/omo/stage/omo_06.c @@ -1,72 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/omo_bt06_shape.h" +#include "../area.h" -#define NAMESPACE b_area_omo_omo_06 - -EvtScript N(updateModels) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_LABEL(0) - EVT_CALL(MakeLerp, 0, LVar9, LVar8, EASING_COS_IN_OUT) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, 0, LVar0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_CALL(MakeLerp, LVar9, 0, LVar8, EASING_COS_IN_OUT) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, 0, LVar0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SET(LVar0, 26) - EVT_SET(LVar1, -50) - EVT_SET(LVar2, 120) - EVT_EXEC(N(updateModels)) - EVT_WAIT(10) - EVT_SET(LVar0, 30) - EVT_SET(LVar1, -80) - EVT_SET(LVar2, 150) - EVT_EXEC(N(updateModels)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_kuruma, - MODEL_hosi, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt06_shape", - .hit = "omo_bt06_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_omo/omo_06.inc.c" diff --git a/src/battle/area/omo/stage/omo_07.c b/src/battle/area/omo/stage/omo_07.c index e99e108e25..9c2f575ae0 100644 --- a/src/battle/area/omo/stage/omo_07.c +++ b/src/battle/area/omo/stage/omo_07.c @@ -1,24 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_omo_omo_07 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt07_shape", - .hit = "omo_bt07_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_07.inc.c" diff --git a/src/battle/area/omo2/actor/general_guy.c b/src/battle/area/omo2/actor/general_guy.c index be05d7cd4f..a885218c6a 100644 --- a/src/battle/area/omo2/actor/general_guy.c +++ b/src/battle/area/omo2/actor/general_guy.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" @@ -168,7 +167,7 @@ EvtScript N(init) = { EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) EVT_CALL(LoadBattleSection, 41) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_shy_squad)), 1) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_shy_squad)), TRUE) EVT_RETURN EVT_END }; @@ -188,7 +187,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP @@ -203,65 +202,65 @@ EvtScript N(handleEvent) = { EVT_SET(LVar2, ANIM_GeneralGuy_Anim09) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SPIKE_TAUNT) EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim02) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_GeneralGuy_Anim02) EVT_SET_CONST(LVar2, ANIM_GeneralGuy_Anim05) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) diff --git a/src/battle/area/omo2/actor/light_bulb.c b/src/battle/area/omo2/actor/light_bulb.c index 6f576119b0..b746a907fc 100644 --- a/src/battle/area/omo2/actor/light_bulb.c +++ b/src/battle/area/omo2/actor/light_bulb.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" diff --git a/src/battle/area/omo2/actor/toy_tank.c b/src/battle/area/omo2/actor/toy_tank.c index f5271f58ee..e783160e8e 100644 --- a/src/battle/area/omo2/actor/toy_tank.c +++ b/src/battle/area/omo2/actor/toy_tank.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" @@ -478,7 +477,7 @@ EvtScript N(start_stilt_guys_phase) = { EVT_CALL(ActorSpeak, MSG_CH4_006A, ACTOR_ENEMY0, PRT_MAIN, ANIM_GeneralGuy_Anim0C, ANIM_GeneralGuy_Anim02) EVT_END_IF EVT_CALL(LoadBattleSection, 44) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_signal_guy)), 1) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_signal_guy)), TRUE) EVT_WAIT(60) EVT_CALL(PlaySoundAtPart, ACTOR_ENEMY0, PRT_MAIN, SOUND_TOY_TANK_MOVE1) EVT_WAIT(5) @@ -527,9 +526,9 @@ EvtScript N(start_shy_stack_phase) = { EVT_CALL(MoveBattleCamOver, 30) EVT_WAIT(10) EVT_CALL(LoadBattleSection, 43) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_shy_stack_1)), 1) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_shy_stack_1)), TRUE) EVT_WAIT(124) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_shy_stack_2)), 1) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_shy_stack_2)), TRUE) EVT_WAIT(114) EVT_CALL(PlayModelAnimation, 0, EVT_PTR(toy_tank_as_idle)) EVT_LABEL(0) @@ -601,9 +600,9 @@ EvtScript N(summon_stilt_guys) = { EVT_CALL(MoveBattleCamOver, 30) EVT_WAIT(10) EVT_CALL(LoadBattleSection, 42) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_stilt_guy_1)), 1) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_stilt_guy_1)), TRUE) EVT_WAIT(60) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_stilt_guy_2)), 1) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_stilt_guy_2)), TRUE) EVT_WAIT(60) EVT_LABEL(1) EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) @@ -664,7 +663,7 @@ EvtScript N(summon_tank_squad) = { EVT_WAIT(30) EVT_CALL(SetAnimation, ACTOR_ENEMY0, PRT_MAIN, ANIM_GeneralGuy_Anim02) EVT_CALL(LoadBattleSection, 45) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_shy_squad_dup)), 1) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_shy_squad_dup)), TRUE) EVT_WAIT(155) EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) EVT_CALL(SetBattleCamZoom, 350) diff --git a/src/battle/area/omo2/area.c b/src/battle/area/omo2/area.c index fbea86b2a4..39ba2d515a 100644 --- a/src/battle/area/omo2/area.c +++ b/src/battle/area/omo2/area.c @@ -1,26 +1,23 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_omo2 +extern ActorBlueprint A(general_guy); +extern ActorBlueprint A(toy_tank); +extern ActorBlueprint A(light_bulb); -extern ActorBlueprint N(general_guy); -extern ActorBlueprint N(toy_tank); -extern ActorBlueprint N(light_bulb); +extern Stage A(omo_07); -extern Stage N(omo_07); - -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(general_guy), BTL_POS_GROUND_C, 70), - ACTOR_BY_IDX(N(toy_tank), BTL_POS_GROUND_B, 80), - ACTOR_BY_IDX(N(light_bulb), BTL_POS_AIR_D, 90), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(general_guy), BTL_POS_GROUND_C, 70), + ACTOR_BY_IDX(A(toy_tank), BTL_POS_GROUND_B, 80), + ACTOR_BY_IDX(A(light_bulb), BTL_POS_AIR_D, 90), }; -BattleList N(Formations) = { - BATTLE(N(Formation_01), N(omo_07), "しょうぐんヘイホー"), +BattleList A(Formations) = { + BATTLE(A(Formation_01), A(omo_07), "しょうぐんヘイホー"), {}, }; -StageList N(Stages) = { - STAGE("omo_07", N(omo_07)), +StageList A(Stages) = { + STAGE("omo_07", A(omo_07)), {}, }; diff --git a/src/battle/area/omo2/area.h b/src/battle/area/omo2/area.h new file mode 100644 index 0000000000..64c953ab37 --- /dev/null +++ b/src/battle/area/omo2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_omo2 diff --git a/src/battle/area/omo2/stage/omo_07.c b/src/battle/area/omo2/stage/omo_07.c index 6a3cabf30e..9c2f575ae0 100644 --- a/src/battle/area/omo2/stage/omo_07.c +++ b/src/battle/area/omo2/stage/omo_07.c @@ -1,24 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_omo2_omo_07 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt07_shape", - .hit = "omo_bt07_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_07.inc.c" diff --git a/src/battle/area/omo2_1/actor/shy_squad.c b/src/battle/area/omo2_1/actor/shy_squad.c index efa11e5ab1..e1c90af09c 100644 --- a/src/battle/area/omo2_1/actor/shy_squad.c +++ b/src/battle/area/omo2_1/actor/shy_squad.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" @@ -582,7 +581,7 @@ EvtScript N(move_squad_to_home) = { }; EvtScript N(displace_last_guy) = { - EVT_SET_CONST(LVar0, 16) + EVT_SET_CONST(LVar0, PRT_16) EVT_EXEC_WAIT(N(displace_guy)) EVT_RETURN EVT_END @@ -756,7 +755,7 @@ EvtScript N(displace_guy) = { }; EvtScript N(onShock) = { - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_LOOP(15) EVT_CALL(GetActorVar, ACTOR_SELF, N(ACTOR_VARS_GUYS_KILLED), LVarD) EVT_CALL(GetActorVar, ACTOR_SELF, N(ACTOR_VAR_TOTAL_DAMAGE), LVarE) @@ -913,7 +912,7 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShySquadGuy_Anim01) EVT_EXEC_WAIT(N(displace_last_guy)) EVT_END_CASE_GROUP @@ -928,11 +927,11 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(move_squad_to_home)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShySquadGuy_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShySquadGuy_Anim0D) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -1072,7 +1071,7 @@ EvtScript N(kill_guy) = { }; EvtScript N(onDeath) = { - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_LOOP(14) EVT_CALL(GetActorVar, ACTOR_SELF, N(ACTOR_VARS_GUYS_KILLED), LVar2) EVT_CALL(GetActorVar, ACTOR_SELF, N(ACTOR_VAR_TOTAL_DAMAGE), LVar3) diff --git a/src/battle/area/omo2_2/actor/stilt_guy.c b/src/battle/area/omo2_2/actor/stilt_guy.c index 1989c65acf..f7fb34466a 100644 --- a/src/battle/area/omo2_2/actor/stilt_guy.c +++ b/src/battle/area/omo2_2/actor/stilt_guy.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/StiltGuy.h" @@ -462,7 +461,7 @@ EvtScript N(return_home) = { EVT_EXEC_WAIT(N(shy_guy_return_home)) EVT_RETURN EVT_END_IF - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim03) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_StiltGuy_Anim01) @@ -478,11 +477,11 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_EXEC_WAIT(N(check_fall_off)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(EVENT_IMMUNE) @@ -501,7 +500,7 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(check_fall_off_2)) @@ -538,38 +537,38 @@ EvtScript N(handleEvent) = { EVT_SET(LVar2, ANIM_StiltGuy_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim0A) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim07) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_EXEC_WAIT(N(return_home)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim07) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim07) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -578,16 +577,16 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(return_home)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_StiltGuy_Anim03) EVT_SET_CONST(LVar2, ANIM_StiltGuy_Anim03) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -957,7 +956,7 @@ EvtScript N(shy_guy_idle) = { EvtScript N(shy_guy_return_home) = { EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) @@ -971,85 +970,85 @@ EvtScript N(shy_guy_handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0E) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(N(shy_guy_on_spin_smash)) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(N(shy_guy_on_spin_smash)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_EXEC_WAIT(N(shy_guy_return_home)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim14) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -1107,7 +1106,7 @@ EvtScript N(shy_guy_attack1) = { EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) @@ -1218,7 +1217,7 @@ EvtScript N(shy_guy_attack2) = { EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) @@ -1303,7 +1302,7 @@ EvtScript N(shy_guy_attack2) = { EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_LABEL(2) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetActorYaw, ACTOR_SELF, 0) diff --git a/src/battle/area/omo2_3/actor/shy_stack.c b/src/battle/area/omo2_3/actor/shy_stack.c index 8f644bdc63..3acd14c942 100644 --- a/src/battle/area/omo2_3/actor/shy_stack.c +++ b/src/battle/area/omo2_3/actor/shy_stack.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" @@ -652,19 +651,19 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVarA) EVT_IF_EQ(LVarA, 3) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE @@ -676,7 +675,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(80235168)) EVT_END_CASE_GROUP EVT_CASE_DEFAULT - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_SWITCH @@ -685,14 +684,14 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_DEATH) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) EVT_ELSE EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVarA) EVT_IF_EQ(LVarA, 3) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) @@ -705,14 +704,14 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(80235168)) EVT_END_CASE_GROUP EVT_CASE_DEFAULT - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) EVT_END_SWITCH EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -768,13 +767,13 @@ EvtScript N(handleEvent) = { EVT_END_SWITCH EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) EVT_IF_FLAG(LVar5, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE @@ -783,20 +782,20 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) EVT_IF_FLAG(LVar5, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE EVT_EXEC_WAIT(N(onSpinSmash)) EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_LAUNCH_HIT) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) EVT_IF_FLAG(LVar5, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE @@ -805,13 +804,13 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_SPIN_SMASH_LAUNCH_DEATH) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) EVT_IF_FLAG(LVar5, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE EVT_EXEC_WAIT(N(80235168)) EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(N(onSpinSmashLaunchDeath)) EVT_RETURN @@ -827,31 +826,31 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) EVT_WAIT(1000) EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar2) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar2) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -887,7 +886,7 @@ EvtScript N(onSpinSmash) = { EVT_CASE_EQ(2) EVT_EXEC_WAIT(N(doSpinSmashHit)) EVT_CASE_EQ(3) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_EXEC_WAIT(N(doSpinSmashHitLastGuy)) EVT_END_SWITCH @@ -1088,7 +1087,7 @@ EvtScript N(doSpinSmashHit) = { EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_10, 0, 0, 0) EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_10, ACTOR_PART_FLAG_INVISIBLE, FALSE) EVT_EXEC_WAIT(N(fall_apart)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) EVT_EXEC_WAIT(N(lower_actor_pos)) diff --git a/src/battle/area/omo2_4/actor/signal_guy.c b/src/battle/area/omo2_4/actor/signal_guy.c index 5c3e27947e..0094cc3d2b 100644 --- a/src/battle/area/omo2_4/actor/signal_guy.c +++ b/src/battle/area/omo2_4/actor/signal_guy.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" @@ -169,16 +168,16 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MarshalGuy_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MarshalGuy_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MarshalGuy_Anim01) EVT_SET_CONST(LVar2, ANIM_MarshalGuy_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) diff --git a/src/battle/area/omo2_5/actor/shy_squad_dup.c b/src/battle/area/omo2_5/actor/shy_squad_dup.c index c2ed628804..83bddee5da 100644 --- a/src/battle/area/omo2_5/actor/shy_squad_dup.c +++ b/src/battle/area/omo2_5/actor/shy_squad_dup.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" @@ -489,7 +488,7 @@ EvtScript N(move_guy_to_pos) = { }; EvtScript N(onSpinSmash) = { - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_LOOP(15) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVarD) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVarE) @@ -675,7 +674,7 @@ EvtScript N(displace_guy) = { }; EvtScript N(onShock) = { - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_LOOP(15) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVarD) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVarE) @@ -808,7 +807,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_SPIKE_TAUNT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TankGuy_Anim01) EVT_EXEC_WAIT(N(onSpinSmash)) EVT_END_CASE_GROUP @@ -817,18 +816,18 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(set_squad_animation)) EVT_WAIT(1000) EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TankGuy_Anim01) EVT_EXEC_WAIT(N(onSpinSmash)) EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TankGuy_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_TankGuy_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) @@ -965,7 +964,7 @@ EvtScript N(80233E48) = { }; EvtScript N(onDeath) = { - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_LOOP(14) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar2) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar3) diff --git a/src/battle/area/omo2_6/actor/shy_guy_dup.c b/src/battle/area/omo2_6/actor/shy_guy_dup.c index 7c7a2e286f..b6e3e7d2cb 100644 --- a/src/battle/area/omo2_6/actor/shy_guy_dup.c +++ b/src/battle/area/omo2_6/actor/shy_guy_dup.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/TankGuy.h" diff --git a/src/battle/area/omo3/actor/big_lantern_ghost.c b/src/battle/area/omo3/actor/big_lantern_ghost.c index a9ad5dabf1..3e8aef13f9 100644 --- a/src/battle/area/omo3/actor/big_lantern_ghost.c +++ b/src/battle/area/omo3/actor/big_lantern_ghost.c @@ -1,11 +1,8 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/BigLanternGhost.h" -#include "effects.h" +#include "../area.h" #include "sprite.h" +#include "sprite/npc/BigLanternGhost.h" -#define NAMESPACE b_area_omo3_big_lantern_ghost +#define NAMESPACE A(big_lantern_ghost) extern s32 N(IdleAnimations)[]; @@ -367,7 +364,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_HIT) EVT_EXEC_WAIT(N(onHit)) EVT_EXEC_WAIT(N(checkExtinguish)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP @@ -385,42 +382,42 @@ EvtScript N(handleEvent) = { EVT_SET(LVar2, 7143435) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim0B) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) EVT_EXEC_WAIT(N(onHit)) EVT_EXEC_WAIT(N(checkExtinguish)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_EXEC_WAIT(N(onHit)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_EXEC_WAIT(N(onHit)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -458,24 +455,24 @@ EvtScript N(handleEvent) = { EVT_END_IF EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_SPIKE_TAUNT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -483,16 +480,16 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(returnHome)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_30) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(1000) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim01) EVT_SET_CONST(LVar2, ANIM_BigLanternGhost_Anim09) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -845,7 +842,7 @@ EvtScript N(takeTurn) = { }; EvtScript N(returnHome) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BigLanternGhost_Anim07) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BigLanternGhost_Anim01) diff --git a/src/battle/area/omo3/actor/clubba.c b/src/battle/area/omo3/actor/clubba.c index 7c2d631824..0db0c21053 100644 --- a/src/battle/area/omo3/actor/clubba.c +++ b/src/battle/area/omo3/actor/clubba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_omo3_clubba +#include "../area.h" #include "battle/common/actor/clubba.inc.c" diff --git a/src/battle/area/omo3/actor/fuzzy.c b/src/battle/area/omo3/actor/fuzzy.c index 8bdebaf1fb..af27120fee 100644 --- a/src/battle/area/omo3/actor/fuzzy.c +++ b/src/battle/area/omo3/actor/fuzzy.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_omo3_fuzzy +#include "../area.h" #include "battle/common/actor/fuzzy.inc.c" diff --git a/src/battle/area/omo3/actor/goomba.c b/src/battle/area/omo3/actor/goomba.c index 5f8d9b9698..7827ad425b 100644 --- a/src/battle/area/omo3/actor/goomba.c +++ b/src/battle/area/omo3/actor/goomba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_omo3_goomba +#include "../area.h" #include "battle/common/actor/goomba.inc.c" diff --git a/src/battle/area/omo3/actor/hammer_bro.c b/src/battle/area/omo3/actor/hammer_bro.c index 4e3476b0f7..5fb167f0e5 100644 --- a/src/battle/area/omo3/actor/hammer_bro.c +++ b/src/battle/area/omo3/actor/hammer_bro.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_omo3_hammer_bro +#include "../area.h" #include "battle/common/actor/hammer_bro.inc.c" diff --git a/src/battle/area/omo3/actor/koopatrol.c b/src/battle/area/omo3/actor/koopatrol.c index 1187a313ef..25c356920f 100644 --- a/src/battle/area/omo3/actor/koopatrol.c +++ b/src/battle/area/omo3/actor/koopatrol.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_omo3_koopatrol +#include "../area.h" #include "battle/common/actor/koopatrol.inc.c" diff --git a/src/battle/area/omo3/actor/pokey.c b/src/battle/area/omo3/actor/pokey.c index 46fadf54c4..907725b1c3 100644 --- a/src/battle/area/omo3/actor/pokey.c +++ b/src/battle/area/omo3/actor/pokey.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_omo3_pokey +#include "../area.h" #include "battle/common/actor/pokey.inc.c" diff --git a/src/battle/area/omo3/actor/red_shy_guy.c b/src/battle/area/omo3/actor/red_shy_guy.c index 546cd45a80..6c887e3d95 100644 --- a/src/battle/area/omo3/actor/red_shy_guy.c +++ b/src/battle/area/omo3/actor/red_shy_guy.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_omo3_red_shy_guy +#include "../area.h" #include "battle/common/actor/red_shy_guy.inc.c" diff --git a/src/battle/area/omo3/area.c b/src/battle/area/omo3/area.c index 637296cfc5..67a441646c 100644 --- a/src/battle/area/omo3/area.c +++ b/src/battle/area/omo3/area.c @@ -1,107 +1,103 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "area.h" -#define NAMESPACE b_area_omo3 +extern Stage A(omo_01); +extern Stage A(omo_02); +extern Stage A(omo_03); +extern Stage A(omo_03b); +extern Stage A(omo_04); +extern Stage A(omo_05); +extern Stage A(omo_05b); +extern Stage A(omo_06); +extern Stage A(omo_07); -extern Stage N(omo_01); -extern Stage N(omo_02); -extern Stage N(omo_03); -extern Stage N(omo_03b); -extern Stage N(omo_04); -extern Stage N(omo_05); -extern Stage N(omo_05b); -extern Stage N(omo_06); -extern Stage N(omo_07); +extern ActorBlueprint A(big_lantern_ghost); +extern ActorBlueprint A(goomba); +extern ActorBlueprint A(clubba); +extern ActorBlueprint A(fuzzy); +extern ActorBlueprint A(hammer_bro); +extern ActorBlueprint A(pokey); +extern ActorBlueprint A(koopatrol); +extern ActorBlueprint A(red_shy_guy); -extern ActorBlueprint N(big_lantern_ghost); -extern ActorBlueprint N(goomba); -extern ActorBlueprint N(clubba); -extern ActorBlueprint N(fuzzy); -extern ActorBlueprint N(hammer_bro); -extern ActorBlueprint N(pokey); -extern ActorBlueprint N(koopatrol); -extern ActorBlueprint N(red_shy_guy); +Vec3i A(big_lantern_ghost_pos) = { 30, 0, 10 }; -Vec3i N(big_lantern_ghost_pos) = { 30, 0, 10 }; - -Formation N(Formation_00) = { - ACTOR_BY_POS(N(big_lantern_ghost), N(big_lantern_ghost_pos), 10), +Formation A(Formation_00) = { + ACTOR_BY_POS(A(big_lantern_ghost), A(big_lantern_ghost_pos), 10), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(goomba), BTL_POS_GROUND_B, 10), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(goomba), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(goomba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(goomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(goomba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(goomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(clubba), BTL_POS_GROUND_C, 9), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(clubba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_C, 9), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(fuzzy), BTL_POS_GROUND_D, 7), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(fuzzy), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_C, 9), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(hammer_bro), BTL_POS_GROUND_B, 10), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(hammer_bro), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 10, 0, 1), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_C, 9, 0, 1), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 10, 0, TRUE), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_C, 9, 0, TRUE), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(koopatrol), BTL_POS_GROUND_C, 9), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(koopatrol), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(red_shy_guy), BTL_POS_GROUND_B, 10), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(red_shy_guy), BTL_POS_GROUND_B, 10), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(omo_03), "ビッグカンテラくん"), - BATTLE(N(Formation_01), N(omo_04), "クリボー(ピーチへん)"), - BATTLE(N(Formation_02), N(omo_04), "クリボーx2(ピーチへん)"), - BATTLE(N(Formation_03), N(omo_04), "ガボンへいx2(ピーチへん)"), - BATTLE(N(Formation_04), N(omo_04), "チョロボンx2(ピーチへん)"), - BATTLE(N(Formation_05), N(omo_04), "チョロボンx4(ピーチへん)"), - BATTLE(N(Formation_06), N(omo_04), "ハンマーブロスx2(ピーチへん)"), - BATTLE(N(Formation_07), N(omo_04), "ハンマーブロス(ピーチへん)"), - BATTLE(N(Formation_08), N(omo_04), "サンボx2(ピーチへん)"), - BATTLE(N(Formation_09), N(omo_04), "トゲノコx2(ピーチへん)"), - BATTLE(N(Formation_0A), N(omo_01), "ヘイホー"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(omo_03), "ビッグカンテラくん"), + BATTLE(A(Formation_01), A(omo_04), "クリボー(ピーチへん)"), + BATTLE(A(Formation_02), A(omo_04), "クリボーx2(ピーチへん)"), + BATTLE(A(Formation_03), A(omo_04), "ガボンへいx2(ピーチへん)"), + BATTLE(A(Formation_04), A(omo_04), "チョロボンx2(ピーチへん)"), + BATTLE(A(Formation_05), A(omo_04), "チョロボンx4(ピーチへん)"), + BATTLE(A(Formation_06), A(omo_04), "ハンマーブロスx2(ピーチへん)"), + BATTLE(A(Formation_07), A(omo_04), "ハンマーブロス(ピーチへん)"), + BATTLE(A(Formation_08), A(omo_04), "サンボx2(ピーチへん)"), + BATTLE(A(Formation_09), A(omo_04), "トゲノコx2(ピーチへん)"), + BATTLE(A(Formation_0A), A(omo_01), "ヘイホー"), {}, }; -StageList N(Stages) = { - STAGE("omo_01", N(omo_01)), - STAGE("omo_02", N(omo_02)), - STAGE("omo_03", N(omo_03)), - STAGE("omo_03b", N(omo_03b)), - STAGE("omo_04", N(omo_04)), - STAGE("omo_05", N(omo_05)), - STAGE("omo_05b", N(omo_05b)), - STAGE("omo_06", N(omo_06)), - STAGE("omo_07", N(omo_07)), +StageList A(Stages) = { + STAGE("omo_01", A(omo_01)), + STAGE("omo_02", A(omo_02)), + STAGE("omo_03", A(omo_03)), + STAGE("omo_03b", A(omo_03b)), + STAGE("omo_04", A(omo_04)), + STAGE("omo_05", A(omo_05)), + STAGE("omo_05b", A(omo_05b)), + STAGE("omo_06", A(omo_06)), + STAGE("omo_07", A(omo_07)), {}, }; diff --git a/src/battle/area/omo3/area.h b/src/battle/area/omo3/area.h new file mode 100644 index 0000000000..64c13af54c --- /dev/null +++ b/src/battle/area/omo3/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_omo3 diff --git a/src/battle/area/omo3/stage/omo_01.c b/src/battle/area/omo3/stage/omo_01.c index 1fda713945..39cffd919b 100644 --- a/src/battle/area/omo3/stage/omo_01.c +++ b/src/battle/area/omo3/stage/omo_01.c @@ -1,103 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/omo_bt01_shape.h" -#include "model.h" +#include "../area.h" -#define NAMESPACE b_area_omo3_omo_01 - -extern EvtScript N(updateModels); - -s32 N(modelList)[] = { MODEL_uma }; - -typedef struct Omo01Struct { - /* 0x00 */ f32 offsetX; - /* 0x04 */ f32 offsetZ; - /* 0x08 */ f32 rotSpeed; - /* 0x0C */ f32 angle; - /* 0x10 */ s32 modelID; - /* 0x14 */ s32 unk_14; -} Omo01Struct; // size = 0x18 - -API_CALLABLE(N(update_model_uma)) { - Omo01Struct* ptr; - Model* model; - f32 rotZ; - f32 offsetY; - s32 i; - Matrix4f mtx1; - Matrix4f mtx2; - - if (isInitialCall) { - ptr = heap_malloc(sizeof(*ptr)); - script->functionTempPtr[0] = ptr; - - for (i = 0; i == 0; i++, ptr++) { - ptr->modelID = N(modelList)[i]; - ptr->unk_14 = ((s32*)N(updateModels))[i]; // WTF ??? - model = get_model_from_list_index(get_model_list_index_from_tree_index(ptr->modelID)); - ptr->offsetX = 0.0f; - ptr->offsetZ = 0.0f; - ptr->rotSpeed = 3.5f; - ptr->angle = 0.0f; - } - } - - ptr = script->functionTempPtr[0]; - for (i = 0; i == 0; i++, ptr++) { - ptr->angle += ptr->rotSpeed; - ptr->angle = clamp_angle(ptr->angle); - - rotZ = sin_rad(ptr->angle * 3.14f / 180.0f) * 20.0f; // the value of PI xD - offsetY = SQ(rotZ) / 90.0f; - - model = get_model_from_list_index(get_model_list_index_from_tree_index(ptr->modelID)); - model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED; - guTranslateF(mtx1, -ptr->offsetX, 0.0f, -ptr->offsetZ); - guRotateF(mtx2, rotZ, 0.0f, 0.0f, 1.0f); - guMtxCatF(mtx1, mtx2, model->transformMatrix); - guTranslateF(mtx1, ptr->offsetX, offsetY, ptr->offsetZ); - guMtxCatF(model->transformMatrix, mtx1, model->transformMatrix); - } - return ApiStatus_BLOCK; -} - -EvtScript N(updateModels) = { - EVT_CALL(N(update_model_uma)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SETF(LVar0, EVT_FLOAT(0.0)) - EVT_SETF(LVar1, EVT_FLOAT(0.0)) - EVT_LOOP(0) - EVT_CALL(RotateModel, MODEL_o367, LVar1, 0, 0, 1) - EVT_CALL(RotateModel, MODEL_hari, LVar0, 0, 0, 1) - EVT_SUBF(LVar0, EVT_FLOAT(0.6)) - EVT_SUBF(LVar1, EVT_FLOAT(7.2)) - EVT_CALL(ClampAngleFloat, LVar0) - EVT_CALL(ClampAngleFloat, LVar1) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_EXEC(N(updateModels)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt01_shape", - .hit = "omo_bt01_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_01.inc.c" diff --git a/src/battle/area/omo3/stage/omo_02.c b/src/battle/area/omo3/stage/omo_02.c index 70b502eefe..913b803ea0 100644 --- a/src/battle/area/omo3/stage/omo_02.c +++ b/src/battle/area/omo3/stage/omo_02.c @@ -1,25 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_omo3_omo_02 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt02_shape", - .hit = "omo_bt02_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_02.inc.c" diff --git a/src/battle/area/omo3/stage/omo_03.c b/src/battle/area/omo3/stage/omo_03.c index 66d940f395..b2f2c85d1b 100644 --- a/src/battle/area/omo3/stage/omo_03.c +++ b/src/battle/area/omo3/stage/omo_03.c @@ -1,26 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_omo3_omo_03 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 18, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt03_shape", - .hit = "omo_bt03_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_03.inc.c" diff --git a/src/battle/area/omo3/stage/omo_03b.c b/src/battle/area/omo3/stage/omo_03b.c index 9c5de836b2..3c65efc08f 100644 --- a/src/battle/area/omo3/stage/omo_03b.c +++ b/src/battle/area/omo3/stage/omo_03b.c @@ -1,25 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_omo3_omo_03b - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt03_shape", - .hit = "omo_bt03_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_03b.inc.c" diff --git a/src/battle/area/omo3/stage/omo_04.c b/src/battle/area/omo3/stage/omo_04.c index 1d9638575c..337743fdfa 100644 --- a/src/battle/area/omo3/stage/omo_04.c +++ b/src/battle/area/omo3/stage/omo_04.c @@ -1,64 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/omo_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_omo3_omo_04 - -extern Formation N(fromation_slot_machine); -extern ActorBlueprint N(slot_machine_stop); -extern ActorBlueprint N(slot_machine_start); - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetTexPanner, 29, TEX_PANNER_A) - EVT_THREAD - EVT_SET(LVarE, 0) - EVT_LOOP(0) - EVT_ADD(LVarE, 32768) - EVT_CALL(SetTexPanOffset, TEX_PANNER_A, TEX_PANNER_MAIN, LVarE, 0) - EVT_WAIT(10) - EVT_END_LOOP - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_itigo, - MODEL_kisya, - MODEL_kusari, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt04_shape", - .hit = "omo_bt04_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), - .stageEnemyCount = 4, - .stageFormation = &N(fromation_slot_machine), -}; - -Vec3i N(slot_machine_pos1) = { -49, 56, -68 }; -Vec3i N(slot_machine_pos2) = { -13, 56, -68 }; -Vec3i N(slot_machine_pos3) = { 20, 56, -68 }; -Vec3i N(slot_machine_pos4) = { 53, 56, -68 }; - -Formation N(fromation_slot_machine) = { - ACTOR_BY_POS(N(slot_machine_start), N(slot_machine_pos1), 0, 0), - ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos2), 0, 1), - ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos3), 0, 2), - ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos4), 0, 3), -}; - -#include "battle/common/actor/slot_machine.inc.c" +#include "battle/common/stage/area_omo/omo_04.inc.c" diff --git a/src/battle/area/omo3/stage/omo_05.c b/src/battle/area/omo3/stage/omo_05.c index 8007d57ad5..5bb7fee6d7 100644 --- a/src/battle/area/omo3/stage/omo_05.c +++ b/src/battle/area/omo3/stage/omo_05.c @@ -1,35 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/omo_bt05_shape.h" +#include "../area.h" -#define NAMESPACE b_area_omo3_omo_05 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 24, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 28, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_itigo, - MODEL_kisya, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt05_shape", - .hit = "omo_bt05_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_omo/omo_05.inc.c" diff --git a/src/battle/area/omo3/stage/omo_05b.c b/src/battle/area/omo3/stage/omo_05b.c index b91e6a4023..7c4199ba40 100644 --- a/src/battle/area/omo3/stage/omo_05b.c +++ b/src/battle/area/omo3/stage/omo_05b.c @@ -1,34 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/omo_bt05_shape.h" +#include "../area.h" -#define NAMESPACE b_area_omo3_omo_05b - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 35, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 45, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_mae2, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt05_shape", - .hit = "omo_bt05_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_omo/omo_05b.inc.c" diff --git a/src/battle/area/omo3/stage/omo_06.c b/src/battle/area/omo3/stage/omo_06.c index a078d62450..80de44f78b 100644 --- a/src/battle/area/omo3/stage/omo_06.c +++ b/src/battle/area/omo3/stage/omo_06.c @@ -1,72 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/omo_bt06_shape.h" +#include "../area.h" -#define NAMESPACE b_area_omo3_omo_06 - -EvtScript N(updateModels) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar9, LVar1) - EVT_SET(LVar8, LVar2) - EVT_LABEL(0) - EVT_CALL(MakeLerp, 0, LVar9, LVar8, EASING_COS_IN_OUT) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, 0, LVar0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_CALL(MakeLerp, LVar9, 0, LVar8, EASING_COS_IN_OUT) - EVT_LOOP(0) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateGroup, LVarA, 0, LVar0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 0) - EVT_BREAK_LOOP - EVT_END_IF - EVT_END_LOOP - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SET(LVar0, 26) - EVT_SET(LVar1, -50) - EVT_SET(LVar2, 120) - EVT_EXEC(N(updateModels)) - EVT_WAIT(10) - EVT_SET(LVar0, 30) - EVT_SET(LVar1, -80) - EVT_SET(LVar2, 150) - EVT_EXEC(N(updateModels)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_kuruma, - MODEL_hosi, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt06_shape", - .hit = "omo_bt06_hit", - .bg = "omo_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_omo/omo_06.inc.c" diff --git a/src/battle/area/omo3/stage/omo_07.c b/src/battle/area/omo3/stage/omo_07.c index c633f6b995..9c2f575ae0 100644 --- a/src/battle/area/omo3/stage/omo_07.c +++ b/src/battle/area/omo3/stage/omo_07.c @@ -1,24 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_omo3_omo_07 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "omo_tex", - .shape = "omo_bt07_shape", - .hit = "omo_bt07_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_omo/omo_07.inc.c" diff --git a/src/battle/area/pra/actor/albino_dino.c b/src/battle/area/pra/actor/albino_dino.c index c502fbbe31..a7ba21d0ff 100644 --- a/src/battle/area/pra/actor/albino_dino.c +++ b/src/battle/area/pra/actor/albino_dino.c @@ -1,325 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "effects.h" -#include "sprite/npc/AlbinoDino.h" +#include "../area.h" -#define NAMESPACE b_area_pra_albino_dino - -extern EvtScript N(init); -extern EvtScript N(idle); -extern EvtScript N(takeTurn); -extern EvtScript N(handleEvent); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_AlbinoDino_Idle, - STATUS_KEY_STONE, ANIM_AlbinoDino_Still, - STATUS_KEY_SLEEP, ANIM_AlbinoDino_Idle, - STATUS_KEY_POISON, ANIM_AlbinoDino_Idle, - STATUS_KEY_STOP, ANIM_AlbinoDino_Still, - STATUS_KEY_STATIC, ANIM_AlbinoDino_Idle, - STATUS_KEY_PARALYZE, ANIM_AlbinoDino_Still, - STATUS_KEY_DIZZY, ANIM_AlbinoDino_Still, - STATUS_KEY_FEAR, ANIM_AlbinoDino_Still, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 4, - ELEMENT_FIRE, 99, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 0, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 0, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 0, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 0, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, -1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -9, 46 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -6, -17 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_ALBINO_DINO, - .level = 23, - .maxHP = 8, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 40, - .airLiftChance = 15, - .hurricaneChance = 10, - .spookChance = 25, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 64, 56 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -22, 24 }, - .statusTextOffset = { 11, 40 }, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(returnHome) = { - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_AlbinoDino_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_AlbinoDino_Idle) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_BurntHurt) - EVT_SET_CONST(LVar2, ANIM_AlbinoDino_BurntStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_BurntHurt) - EVT_SET_CONST(LVar2, ANIM_AlbinoDino_BurntStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_BurntStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Run) - EVT_SET_CONST(LVar2, ANIM_AlbinoDino_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(stamp) = { - EVT_SET(LVarA, 0) - EVT_LABEL(0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetActorYaw, ACTOR_SELF, LVar3) - EVT_IF_EQ(LVar3, 0) - EVT_ADD(LVar0, 20) - EVT_ELSE - EVT_ADD(LVar0, -20) - EVT_END_IF - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 25, 8, 45, 20, 0) - EVT_IF_GT(LVarA, 3) - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 2, EVT_FLOAT(0.2)) - EVT_SET(LVarA, 0) - EVT_END_IF - EVT_ADD(LVarA, 1) - EVT_WAIT(2) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_EXEC_GET_TID(N(stamp), LVar9) - EVT_THREAD - EVT_LOOP(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_30B) - EVT_WAIT(4) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FD) - EVT_WAIT(4) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_AlbinoDino_Run) - EVT_WAIT(20) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarF, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVarF) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_THREAD - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, -100, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_KILL_THREAD(LVar9) - EVT_END_THREAD - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_WAIT(30) - EVT_IF_EQ(LVarF, HIT_RESULT_LUCKY) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(40) - EVT_CALL(YieldTurn) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_CALL(AddGoalPos, ACTOR_SELF, 12, 0, 0) - EVT_ELSE - EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) - EVT_END_IF - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 4, EVT_FLOAT(1.5)) - EVT_END_THREAD - EVT_KILL_THREAD(LVar9) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - // invalid status field has 24% chance, but no status and doesn't have STATUS_FLAG_80000000 set - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, 0, 0, 24, 4, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVarF) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FD) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_AlbinoDino_Idle) - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 3, EVT_FLOAT(1.0)) - EVT_WAIT(10) - EVT_CALL(YieldTurn) - EVT_EXEC_WAIT(N(returnHome)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/albino_dino.inc.c" diff --git a/src/battle/area/pra/actor/gray_magikoopa.c b/src/battle/area/pra/actor/gray_magikoopa.c index fde27ea6cd..ccde828baf 100644 --- a/src/battle/area/pra/actor/gray_magikoopa.c +++ b/src/battle/area/pra/actor/gray_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra_gray_magikoopa +#include "../area.h" #include "battle/common/actor/gray_magikoopa.inc.c" diff --git a/src/battle/area/pra/actor/green_magikoopa.c b/src/battle/area/pra/actor/green_magikoopa.c index 4791ea6b3d..83b627cff9 100644 --- a/src/battle/area/pra/actor/green_magikoopa.c +++ b/src/battle/area/pra/actor/green_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra_green_magikoopa +#include "../area.h" #include "battle/common/actor/green_magikoopa.inc.c" diff --git a/src/battle/area/pra/actor/red_magikoopa.c b/src/battle/area/pra/actor/red_magikoopa.c index cea9c6c5ef..b61876c1b6 100644 --- a/src/battle/area/pra/actor/red_magikoopa.c +++ b/src/battle/area/pra/actor/red_magikoopa.c @@ -1,21 +1,3 @@ -#include "common.h" -#include "effects.h" - -#define NAMESPACE b_area_pra_red_magikoopa - -API_CALLABLE(func_80218240_649050) { - Bytecode* args = script->ptrReadPos; - EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++); - f32 var1 = evt_get_variable(script, *args++); - f32 var2 = evt_get_variable(script, *args++); - f32 var3 = evt_get_variable(script, *args++); - - // function is never called, so the effect type can't be inferred - ((f32*)effect->data.any)[14] = var1; - ((f32*)effect->data.any)[15] = var2; - ((f32*)effect->data.any)[16] = var3; - - return ApiStatus_DONE2; -} +#include "../area.h" #include "battle/common/actor/red_magikoopa.inc.c" diff --git a/src/battle/area/pra/actor/swoopula.c b/src/battle/area/pra/actor/swoopula.c index bdce30a876..465ffaafe3 100644 --- a/src/battle/area/pra/actor/swoopula.c +++ b/src/battle/area/pra/actor/swoopula.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra_swoopula +#include "../area.h" #include "battle/common/actor/swoopula.inc.c" diff --git a/src/battle/area/pra/actor/white_clubba.c b/src/battle/area/pra/actor/white_clubba.c index e5a6a5101b..1a5471d846 100644 --- a/src/battle/area/pra/actor/white_clubba.c +++ b/src/battle/area/pra/actor/white_clubba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra_white_clubba +#include "../area.h" #include "battle/common/actor/white_clubba.inc.c" diff --git a/src/battle/area/pra/actor/white_magikoopa.c b/src/battle/area/pra/actor/white_magikoopa.c index fdb0998f4e..8e56b247f1 100644 --- a/src/battle/area/pra/actor/white_magikoopa.c +++ b/src/battle/area/pra/actor/white_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra_white_magikoopa +#include "../area.h" #include "battle/common/actor/white_magikoopa.inc.c" diff --git a/src/battle/area/pra/actor/yellow_magikoopa.c b/src/battle/area/pra/actor/yellow_magikoopa.c index 3544da16d1..bbc5059838 100644 --- a/src/battle/area/pra/actor/yellow_magikoopa.c +++ b/src/battle/area/pra/actor/yellow_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra_yellow_magikoopa +#include "../area.h" #include "battle/common/actor/yellow_magikoopa.inc.c" diff --git a/src/battle/area/pra/area.c b/src/battle/area/pra/area.c index ec85d3d276..bbc3658d28 100644 --- a/src/battle/area/pra/area.c +++ b/src/battle/area/pra/area.c @@ -1,162 +1,159 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_pra +extern ActorBlueprint A(swoopula); +extern ActorBlueprint A(red_magikoopa); +extern ActorBlueprint A(gray_magikoopa); +extern ActorBlueprint A(white_magikoopa); +extern ActorBlueprint A(white_magikoopa_flying); +extern ActorBlueprint A(green_magikoopa); +extern ActorBlueprint A(yellow_magikoopa); +extern ActorBlueprint A(yellow_magikoopa_flying); +extern ActorBlueprint A(white_clubba); +extern ActorBlueprint A(albino_dino); -extern ActorBlueprint N(swoopula); -extern ActorBlueprint N(red_magikoopa); -extern ActorBlueprint N(gray_magikoopa); -extern ActorBlueprint N(white_magikoopa); -extern ActorBlueprint N(white_magikoopa_flying); -extern ActorBlueprint N(green_magikoopa); -extern ActorBlueprint N(yellow_magikoopa); -extern ActorBlueprint N(yellow_magikoopa_flying); -extern ActorBlueprint N(white_clubba); -extern ActorBlueprint N(albino_dino); - -extern Stage N(pra_01); -extern Stage N(pra_02); -extern Stage N(pra_03); -extern Stage N(pra_03b); -extern Stage N(pra_03c); -extern Stage N(pra_04); +extern Stage A(pra_01); +extern Stage A(pra_02); +extern Stage A(pra_03); +extern Stage A(pra_03b); +extern Stage A(pra_03c); +extern Stage A(pra_04); -Vec3i N(pos_swoopula)[] = { +Vec3i A(pos_swoopula)[] = { { 15, 133, -25 }, { 55, 133, -25 }, { 95, 133, -25 }, { 135, 133, -25 }, }; -Formation N(Formation_01) = { - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[1], 10), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[2], 9), +Formation A(Formation_01) = { + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[1], 10), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[2], 9), }; -Formation N(Formation_02) = { - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[0], 10), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[1], 9), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[2], 8), +Formation A(Formation_02) = { + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[0], 10), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[1], 9), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[2], 8), }; -Vec3i N(pos_swoopula_2)[] = { +Vec3i A(pos_swoopula_2)[] = { { 0, 133, -25 }, { 40, 133, -25 }, { 80, 133, -25 }, { 120, 133, -25 }, }; -Formation N(Formation_03) = { - ACTOR_BY_POS(N(swoopula), N(pos_swoopula_2)[0], 10), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula_2)[1], 9), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula_2)[2], 8), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula_2)[3], 7), +Formation A(Formation_03) = { + ACTOR_BY_POS(A(swoopula), A(pos_swoopula_2)[0], 10), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula_2)[1], 9), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula_2)[2], 8), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula_2)[3], 7), }; -Vec3i N(pos_swoopula_3)[] = { +Vec3i A(pos_swoopula_3)[] = { { 0, 133, -25 }, { 40, 133, -25 }, { 80, 133, -25 }, }; -Vec3i N(pos_magikoopa) = { 120, 55, 25 }; +Vec3i A(pos_magikoopa) = { 120, 55, 25 }; -Formation N(Formation_04) = { - ACTOR_BY_POS(N(swoopula), N(pos_swoopula_3)[0], 10, 0xFFFFFFFF), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula_3)[1], 9, 0xFFFFFFFF), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula_3)[2], 8, 0xFFFFFFFF), - ACTOR_BY_POS(N(yellow_magikoopa_flying), N(pos_magikoopa), 7), +Formation A(Formation_04) = { + ACTOR_BY_POS(A(swoopula), A(pos_swoopula_3)[0], 10, 0xFFFFFFFF), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula_3)[1], 9, 0xFFFFFFFF), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula_3)[2], 8, 0xFFFFFFFF), + ACTOR_BY_POS(A(yellow_magikoopa_flying), A(pos_magikoopa), 7), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 10), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_C, 9), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_C, 8), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[2], 8), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[2], 8), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(yellow_magikoopa), BTL_POS_GROUND_C, 9), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(yellow_magikoopa), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(white_magikoopa), BTL_POS_GROUND_C, 9), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(white_magikoopa), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(white_magikoopa), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(red_magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(white_magikoopa), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(red_magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(gray_magikoopa), BTL_POS_GROUND_C, 9), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(gray_magikoopa), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(green_magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(green_magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(green_magikoopa), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(white_magikoopa_flying), BTL_POS_AIR_D, 7), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(green_magikoopa), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(white_magikoopa_flying), BTL_POS_AIR_D, 7), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(albino_dino), BTL_POS_GROUND_B, 10) +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(albino_dino), BTL_POS_GROUND_B, 10) }; -BattleList N(Formations) = { - BATTLE(N(Formation_01), N(pra_01), "バサバサチュルルx2"), - BATTLE(N(Formation_02), N(pra_01), "バサバサチュルルx3"), - BATTLE(N(Formation_03), N(pra_01), "バサバサチュルルx4"), - BATTLE(N(Formation_04), N(pra_01), "バサバサチュルルx3,イエローカメック(そら)"), - BATTLE(N(Formation_05), N(pra_01), "ホワイトガボン"), - BATTLE(N(Formation_06), N(pra_01), "ホワイトガボンx2"), - BATTLE(N(Formation_07), N(pra_01), "ホワイトガボンx3"), - BATTLE(N(Formation_08), N(pra_01), "ホワイトガボンx2,バサバサチュルル"), - BATTLE(N(Formation_09), N(pra_01), "ホワイトガボンx2,イエローカメック"), - BATTLE(N(Formation_0A), N(pra_01), "ホワイトガボンx2,ホワイトカメック"), - BATTLE(N(Formation_0B), N(pra_01), "ホワイトガボンx2,ホワイトカメック,レッドカメック"), - BATTLE(N(Formation_0C), N(pra_01), "ホワイトガボン,グレイカメック"), - BATTLE(N(Formation_0D), N(pra_01), "ホワイトガボンx3,グリーンカメック"), - BATTLE(N(Formation_0E), N(pra_01), "ホワイトガボンx2,グリーンカメック,ホワイトカメック(そら)"), - BATTLE(N(Formation_0F), N(pra_01), "セキゾー"), +BattleList A(Formations) = { + BATTLE(A(Formation_01), A(pra_01), "バサバサチュルルx2"), + BATTLE(A(Formation_02), A(pra_01), "バサバサチュルルx3"), + BATTLE(A(Formation_03), A(pra_01), "バサバサチュルルx4"), + BATTLE(A(Formation_04), A(pra_01), "バサバサチュルルx3,イエローカメック(そら)"), + BATTLE(A(Formation_05), A(pra_01), "ホワイトガボン"), + BATTLE(A(Formation_06), A(pra_01), "ホワイトガボンx2"), + BATTLE(A(Formation_07), A(pra_01), "ホワイトガボンx3"), + BATTLE(A(Formation_08), A(pra_01), "ホワイトガボンx2,バサバサチュルル"), + BATTLE(A(Formation_09), A(pra_01), "ホワイトガボンx2,イエローカメック"), + BATTLE(A(Formation_0A), A(pra_01), "ホワイトガボンx2,ホワイトカメック"), + BATTLE(A(Formation_0B), A(pra_01), "ホワイトガボンx2,ホワイトカメック,レッドカメック"), + BATTLE(A(Formation_0C), A(pra_01), "ホワイトガボン,グレイカメック"), + BATTLE(A(Formation_0D), A(pra_01), "ホワイトガボンx3,グリーンカメック"), + BATTLE(A(Formation_0E), A(pra_01), "ホワイトガボンx2,グリーンカメック,ホワイトカメック(そら)"), + BATTLE(A(Formation_0F), A(pra_01), "セキゾー"), {}, }; -StageList N(Stages) = { - STAGE("pra_01", N(pra_01)), - STAGE("pra_02", N(pra_02)), - STAGE("pra_03", N(pra_03)), - STAGE("pra_03b", N(pra_03b)), - STAGE("pra_03c", N(pra_03c)), - STAGE("pra_04", N(pra_04)), +StageList A(Stages) = { + STAGE("pra_01", A(pra_01)), + STAGE("pra_02", A(pra_02)), + STAGE("pra_03", A(pra_03)), + STAGE("pra_03b", A(pra_03b)), + STAGE("pra_03c", A(pra_03c)), + STAGE("pra_04", A(pra_04)), {}, }; diff --git a/src/battle/area/pra/area.h b/src/battle/area/pra/area.h new file mode 100644 index 0000000000..784a5b0f6b --- /dev/null +++ b/src/battle/area/pra/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_pra diff --git a/src/battle/area/pra/stage/pra_01.c b/src/battle/area/pra/stage/pra_01.c index f845bc700f..46499345d4 100644 --- a/src/battle/area/pra/stage/pra_01.c +++ b/src/battle/area/pra/stage/pra_01.c @@ -1,35 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/pra_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_pra_pra_01 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(EnableBattleFloorReflections, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o384, - MODEL_o385, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt01_shape", - .hit = "pra_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_pra/pra_01.inc.c" diff --git a/src/battle/area/pra/stage/pra_02.c b/src/battle/area/pra/stage/pra_02.c index cbe0653233..6b8120afc1 100644 --- a/src/battle/area/pra/stage/pra_02.c +++ b/src/battle/area/pra/stage/pra_02.c @@ -1,98 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/pra_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_pra_pra_02 - -EvtScript N(80231B40) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80231C10) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80231CFC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(EnableBattleFloorReflections, TRUE) - EVT_SET(LVar0, 17) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 3000) - EVT_SET(LVar3, 0) - EVT_EXEC(N(80231B40)) - EVT_SET(LVar0, 18) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 3000) - EVT_SET(LVar3, 0) - EVT_EXEC(N(80231B40)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o384, - MODEL_o385, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt02_shape", - .hit = "pra_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_pra/pra_02.inc.c" diff --git a/src/battle/area/pra/stage/pra_03.c b/src/battle/area/pra/stage/pra_03.c index 1e2c0e4add..0a6ccfba61 100644 --- a/src/battle/area/pra/stage/pra_03.c +++ b/src/battle/area/pra/stage/pra_03.c @@ -1,24 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_pra_pra_03 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt03_shape", - .hit = "pra_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_pra/pra_03.inc.c" diff --git a/src/battle/area/pra/stage/pra_03b.c b/src/battle/area/pra/stage/pra_03b.c index 8ea0207f58..041ecc4bac 100644 --- a/src/battle/area/pra/stage/pra_03b.c +++ b/src/battle/area/pra/stage/pra_03b.c @@ -1,25 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_pra_pra_03b - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 33, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt03_shape", - .hit = "pra_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_pra/pra_03b.inc.c" diff --git a/src/battle/area/pra/stage/pra_03c.c b/src/battle/area/pra/stage/pra_03c.c index 95532635a8..9bf0723701 100644 --- a/src/battle/area/pra/stage/pra_03c.c +++ b/src/battle/area/pra/stage/pra_03c.c @@ -1,26 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_pra_pra_03c - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 33, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 38, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt03_shape", - .hit = "pra_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_pra/pra_03c.inc.c" diff --git a/src/battle/area/pra/stage/pra_04.c b/src/battle/area/pra/stage/pra_04.c index 87b6d1b8b1..af43aa3b13 100644 --- a/src/battle/area/pra/stage/pra_04.c +++ b/src/battle/area/pra/stage/pra_04.c @@ -1,90 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/pra_bt04_shape.h" +#include "../area.h" -#define NAMESPACE b_area_pra_pra_04 - -EvtScript N(EVS_TexPan_Glass) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, TEX_PANNER_MAIN, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802321A0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, TEX_PANNER_MAIN, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, TEX_PANNER_AUX, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8023228C) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, TEX_PANNER_MAIN, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, TEX_PANNER_AUX, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, MODEL_kira1) - EVT_SET(LVar1, TEX_PANNER_0) - EVT_SET(LVar2, 3000) - EVT_SET(LVar3, 0) - EVT_EXEC(N(EVS_TexPan_Glass)) - EVT_SET(LVar0, MODEL_kira2) - EVT_SET(LVar1, TEX_PANNER_1) - EVT_SET(LVar2, 3000) - EVT_SET(LVar3, 0) - EVT_EXEC(N(EVS_TexPan_Glass)) - EVT_CALL(EnableBattleFloorReflections, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt04_shape", - .hit = "pra_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_pra/pra_04.inc.c" diff --git a/src/battle/area/pra2/actor/crystal_bit.c b/src/battle/area/pra2/actor/crystal_bit.c index 13cb26f26f..2f1881026b 100644 --- a/src/battle/area/pra2/actor/crystal_bit.c +++ b/src/battle/area/pra2/actor/crystal_bit.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "effects.h" +#include "../area.h" #include "sprite/npc/CrystalKing.h" -#define NAMESPACE b_area_pra2_crystal_bit +#define NAMESPACE A(crystal_bit) extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -263,7 +260,7 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP @@ -271,19 +268,19 @@ EvtScript N(handleEvent) = { EVT_CALL(GetOwnerID, LVar0) EVT_CALL(GetActorVar, ACTOR_ENEMY0, 4, LVar3) EVT_IF_EQ(LVar0, LVar3) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim22) EVT_SET_CONST(LVar2, -1) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_ENEMY0, 5, LVar3) EVT_IF_EQ(LVar0, LVar3) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim23) EVT_SET_CONST(LVar2, -1) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_ENEMY0, 6, LVar3) EVT_IF_EQ(LVar0, LVar3) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim24) EVT_SET_CONST(LVar2, -1) EVT_END_IF @@ -291,12 +288,12 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(HideHealthBar, ACTOR_SELF) @@ -344,19 +341,19 @@ EvtScript N(handleEvent) = { EVT_CALL(GetOwnerID, LVar0) EVT_CALL(GetActorVar, ACTOR_ENEMY0, 4, LVar3) EVT_IF_EQ(LVar0, LVar3) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim22) EVT_SET_CONST(LVar2, -1) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_ENEMY0, 5, LVar3) EVT_IF_EQ(LVar0, LVar3) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim23) EVT_SET_CONST(LVar2, -1) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_ENEMY0, 6, LVar3) EVT_IF_EQ(LVar0, LVar3) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim24) EVT_SET_CONST(LVar2, -1) EVT_END_IF diff --git a/src/battle/area/pra2/actor/crystal_king.c b/src/battle/area/pra2/actor/crystal_king.c index e8d93c7981..03da43c309 100644 --- a/src/battle/area/pra2/actor/crystal_king.c +++ b/src/battle/area/pra2/actor/crystal_king.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "effects.h" +#include "../area.h" #include "sprite/npc/CrystalKing.h" -#define NAMESPACE b_area_pra2_crystal_king +#define NAMESPACE A(crystal_king) enum N(ActorPartIDs) { PRT_MAIN = 1, @@ -42,9 +39,9 @@ enum N(ActorVars) { static Vec3f N(paths)[3][3]; -extern ActorBlueprint b_area_pra2_crystal_bit_1; -extern ActorBlueprint b_area_pra2_crystal_bit_2; -extern ActorBlueprint b_area_pra2_crystal_bit_3; +extern ActorBlueprint A(crystal_bit_1); +extern ActorBlueprint A(crystal_bit_2); +extern ActorBlueprint A(crystal_bit_3); extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -562,7 +559,7 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_CrystalKing_Anim09) @@ -573,13 +570,13 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_CrystalKing_Anim09) EVT_END_THREAD EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) @@ -588,7 +585,7 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_CrystalKing_Anim09) @@ -599,13 +596,13 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_CrystalKing_Anim09) EVT_END_THREAD EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(OnHit)) @@ -615,7 +612,7 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim20) EVT_SET_CONST(LVar2, ANIM_CrystalKing_Anim21) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -626,13 +623,13 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim20) EVT_SET_CONST(LVar2, ANIM_CrystalKing_Anim21) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_END_THREAD EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim20) EVT_SET_CONST(LVar2, ANIM_CrystalKing_Anim21) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -640,11 +637,11 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(OnHit)) EVT_CASE_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim09) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim09) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetActorVar, ACTOR_ENEMY0, N(VAR_FLAGS), LVar0) @@ -663,7 +660,7 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_THREAD @@ -673,16 +670,16 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_THREAD EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -692,7 +689,7 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim20) EVT_SET_CONST(LVar2, ANIM_CrystalKing_Anim21) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -703,18 +700,18 @@ EvtScript N(handleEvent) = { EVT_IF_EQ(LVar1, TRUE) EVT_THREAD EVT_CALL(SetOwnerID, LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim20) EVT_SET_CONST(LVar2, ANIM_CrystalKing_Anim21) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_END_THREAD EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim20) EVT_SET_CONST(LVar2, ANIM_CrystalKing_Anim21) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim21) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -771,7 +768,7 @@ EvtScript N(handleEvent) = { EVT_END_CASE_GROUP EVT_END_SWITCH EVT_END_THREAD - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CALL(CountPlayerTargets, ACTOR_SELF, TARGET_FLAG_2 | TARGET_FLAG_8000, LVar0) @@ -786,7 +783,7 @@ EvtScript N(handleEvent) = { EVT_CALL(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_CrystalKing_Anim19) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_SWAP_PARTNER) @@ -1230,14 +1227,14 @@ EvtScript N(MakeIllusions) = { EVT_CALL(MoveBattleCamOver, 15) EVT_WAIT(15) EVT_CALL(GetActorHP, ACTOR_SELF, LVarA) - EVT_CALL(SummonEnemy, EVT_PTR(N(clone_formation)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(clone_formation)), FALSE) EVT_CALL(SetActorFlagBits, LVar0, ACTOR_FLAG_NO_SHADOW, TRUE) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_CLONE1_ID), LVar0) EVT_CALL(SetPartEventBits, LVar0, 1, ACTOR_EVENT_FLAG_ILLUSORY, TRUE) EVT_CALL(SetEnemyHP, LVar0, LVarA) EVT_CALL(CopyStatusEffects, ACTOR_SELF, LVar0) EVT_CALL(CopyBuffs, ACTOR_SELF, LVar0) - EVT_CALL(SummonEnemy, EVT_PTR(N(clone_formation)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(clone_formation)), FALSE) EVT_CALL(SetActorFlagBits, LVar0, ACTOR_FLAG_NO_SHADOW, TRUE) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_CLONE2_ID), LVar0) EVT_CALL(SetPartEventBits, LVar0, 1, ACTOR_EVENT_FLAG_ILLUSORY, TRUE) @@ -1416,15 +1413,15 @@ EvtScript N(MakeIllusions) = { }; Formation N(formation_bit_1) = { - ACTOR_BY_POS(b_area_pra2_crystal_bit_1, N(pos_crystal_clone), 0), + ACTOR_BY_POS(A(crystal_bit_1), N(pos_crystal_clone), 0), }; Formation N(formation_bit_2) = { - ACTOR_BY_POS(b_area_pra2_crystal_bit_2, N(pos_crystal_clone), 0), + ACTOR_BY_POS(A(crystal_bit_2), N(pos_crystal_clone), 0), }; Formation N(formation_bit_3) = { - ACTOR_BY_POS(b_area_pra2_crystal_bit_3, N(pos_crystal_clone), 0), + ACTOR_BY_POS(A(crystal_bit_3), N(pos_crystal_clone), 0), }; s32 N(array_1)[16] = { }; @@ -1492,11 +1489,11 @@ EvtScript N(SummonCrystalBits) = { EVT_WAIT(15) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_CrystalKing_Anim1E) EVT_WAIT(20) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bit_1)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bit_1)), FALSE) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_BIT1_ID), LVar0) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bit_2)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bit_2)), FALSE) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_BIT2_ID), LVar0) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bit_3)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bit_3)), FALSE) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_BIT3_ID), LVar0) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) diff --git a/src/battle/area/pra2/area.c b/src/battle/area/pra2/area.c index 4c228b1c36..2839614c6e 100644 --- a/src/battle/area/pra2/area.c +++ b/src/battle/area/pra2/area.c @@ -1,36 +1,31 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_pra2 +extern ActorBlueprint A(crystal_king); +extern ActorBlueprint A(crystal_bit_1); +extern ActorBlueprint A(crystal_bit_2); +extern ActorBlueprint A(crystal_bit_3); -extern ActorBlueprint N(crystal_king); -extern ActorBlueprint N(crystal_bit_1); -extern ActorBlueprint N(crystal_bit_2); -extern ActorBlueprint N(crystal_bit_3); +extern Stage A(sam_04); -extern Stage N(sam_04); +Vec3i A(KingPos) = { 70, 0, 5 }; -Vec3i N(pos_crystal_king) = { 70, 0, 5 }; +Vec3i A(CrystalBitPos1) = { 10, 35, -5 }; +Vec3i A(CrystalBitPos2) = { 112, 52, -5 }; +Vec3i A(CrystalBitPos3) = { 42, 85, -10 }; -Vec3i N(pos_crystal_bit_1) = { 10, 35, -5 }; - -Vec3i N(pos_crystal_bit_2) = { 112, 52, -5 }; - -Vec3i N(pos_crystal_bit_3) = { 42, 85, -10 }; - -Formation N(Formation_01) = { - ACTOR_BY_POS(N(crystal_king), N(pos_crystal_king), 10), - ACTOR_BY_POS(N(crystal_bit_1), N(pos_crystal_bit_1), 9), - ACTOR_BY_POS(N(crystal_bit_2), N(pos_crystal_bit_2), 8), - ACTOR_BY_POS(N(crystal_bit_3), N(pos_crystal_bit_3), 7), +Formation A(Formation_01) = { + ACTOR_BY_POS(A(crystal_king), A(KingPos), 10), + ACTOR_BY_POS(A(crystal_bit_1), A(CrystalBitPos1), 9), + ACTOR_BY_POS(A(crystal_bit_2), A(CrystalBitPos2), 8), + ACTOR_BY_POS(A(crystal_bit_3), A(CrystalBitPos3), 7), }; -BattleList N(Formations) = { - BATTLE(N(Formation_01), N(sam_04), "パラレラー"), +BattleList A(Formations) = { + BATTLE(A(Formation_01), A(sam_04), "パラレラー"), {}, }; -StageList N(Stages) = { - STAGE("sam_04", N(sam_04)), +StageList A(Stages) = { + STAGE("sam_04", A(sam_04)), {}, }; diff --git a/src/battle/area/pra2/area.h b/src/battle/area/pra2/area.h new file mode 100644 index 0000000000..3633be4193 --- /dev/null +++ b/src/battle/area/pra2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_pra2 diff --git a/src/battle/area/pra2/stage/sam_04.c b/src/battle/area/pra2/stage/sam_04.c index ebf246faf9..76e9769d57 100644 --- a/src/battle/area/pra2/stage/sam_04.c +++ b/src/battle/area/pra2/stage/sam_04.c @@ -1,32 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_pra2_sam_04 - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -void func_802189E0_661130(void) { - enable_background_wave(); -} - - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt04_shape", - .hit = "sam_bt04_hit", - .bg = "sam_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_sam/sam_04.inc.c" diff --git a/src/battle/area/pra3/actor/duplighost.c b/src/battle/area/pra3/actor/duplighost.c index 7fc7e7b5f9..73800cf8dc 100644 --- a/src/battle/area/pra3/actor/duplighost.c +++ b/src/battle/area/pra3/actor/duplighost.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra3_duplighost +#include "../area.h" #include "battle/common/actor/duplighost.inc.c" diff --git a/src/battle/area/pra3/actor/gray_magikoopa.c b/src/battle/area/pra3/actor/gray_magikoopa.c index 543f728b05..ccde828baf 100644 --- a/src/battle/area/pra3/actor/gray_magikoopa.c +++ b/src/battle/area/pra3/actor/gray_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra3_gray_magikoopa +#include "../area.h" #include "battle/common/actor/gray_magikoopa.inc.c" diff --git a/src/battle/area/pra3/actor/red_magikoopa.c b/src/battle/area/pra3/actor/red_magikoopa.c index 184f563a21..b61876c1b6 100644 --- a/src/battle/area/pra3/actor/red_magikoopa.c +++ b/src/battle/area/pra3/actor/red_magikoopa.c @@ -1,3 +1,3 @@ -#define NAMESPACE b_area_pra3_red_magikoopa +#include "../area.h" #include "battle/common/actor/red_magikoopa.inc.c" diff --git a/src/battle/area/pra3/actor/swoopula.c b/src/battle/area/pra3/actor/swoopula.c index 7786a878cf..465ffaafe3 100644 --- a/src/battle/area/pra3/actor/swoopula.c +++ b/src/battle/area/pra3/actor/swoopula.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra3_swoopula +#include "../area.h" #include "battle/common/actor/swoopula.inc.c" diff --git a/src/battle/area/pra3/actor/white_clubba.c b/src/battle/area/pra3/actor/white_clubba.c index 4815b31fd3..1a5471d846 100644 --- a/src/battle/area/pra3/actor/white_clubba.c +++ b/src/battle/area/pra3/actor/white_clubba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_pra3_white_clubba +#include "../area.h" #include "battle/common/actor/white_clubba.inc.c" diff --git a/src/battle/area/pra3/area.c b/src/battle/area/pra3/area.c index 451b4370c9..8c633a1169 100644 --- a/src/battle/area/pra3/area.c +++ b/src/battle/area/pra3/area.c @@ -1,120 +1,117 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_pra3 +extern ActorBlueprint A(swoopula); +extern ActorBlueprint A(duplighost); +extern ActorBlueprint A(red_magikoopa); +extern ActorBlueprint A(gray_magikoopa); +extern ActorBlueprint A(white_clubba); -extern ActorBlueprint N(swoopula); -extern ActorBlueprint N(duplighost); -extern ActorBlueprint N(red_magikoopa); -extern ActorBlueprint N(gray_magikoopa); -extern ActorBlueprint N(white_clubba); +extern Stage A(pra_01); +extern Stage A(pra_02); +extern Stage A(pra_03); +extern Stage A(pra_03b); +extern Stage A(pra_03c); +extern Stage A(pra_04); -extern Stage N(pra_01); -extern Stage N(pra_02); -extern Stage N(pra_03); -extern Stage N(pra_03b); -extern Stage N(pra_03c); -extern Stage N(pra_04); - -Vec3i N(pos_swoopula)[] = { +Vec3i A(pos_swoopula)[] = { { 15, 133, -25 }, { 55, 133, -25 }, { 95, 133, -25 }, { 135, 133, -25 }, }; -Formation N(Formation_01) = { - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[0], 10), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[1], 9), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 8), +Formation A(Formation_01) = { + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[0], 10), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[1], 9), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 10), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 9), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 8), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_D, 7), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 9), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[2], 8), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 9), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[2], 8), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_A, 10), - ACTOR_BY_POS(N(swoopula), N(pos_swoopula)[1], 9), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 8), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_A, 10), + ACTOR_BY_POS(A(swoopula), A(pos_swoopula)[1], 9), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(red_magikoopa), BTL_POS_GROUND_C, 9), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(red_magikoopa), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(red_magikoopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(red_magikoopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 8), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(gray_magikoopa), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(red_magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(gray_magikoopa), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(red_magikoopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 8), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 8), }; -BattleList N(Formations) = { - BATTLE(N(Formation_01), N(pra_01), "バサバサチュルルx2,バケバケ"), - BATTLE(N(Formation_02), N(pra_01), "バケバケ"), - BATTLE(N(Formation_03), N(pra_01), "バケバケx2"), - BATTLE(N(Formation_04), N(pra_01), "バケバケx3"), - BATTLE(N(Formation_05), N(pra_01), "バケバケx4"), - BATTLE(N(Formation_06), N(pra_01), "バケバケx2,バサバサチュルル"), - BATTLE(N(Formation_07), N(pra_01), "バケバケ,バサバサチュルル,バケバケ"), - BATTLE(N(Formation_08), N(pra_01), "バケバケ,レッドカメック"), - BATTLE(N(Formation_09), N(pra_01), "バケバケx2,レッドカメック"), - BATTLE(N(Formation_0A), N(pra_01), "バケバケ,ホワイトガボン,バケバケ"), - BATTLE(N(Formation_0B), N(pra_01), "バケバケx2,グレイカメック,レッドカメック"), - BATTLE(N(Formation_0C), N(pra_01), "ホワイトガボンx2,バケバケ"), +BattleList A(Formations) = { + BATTLE(A(Formation_01), A(pra_01), "バサバサチュルルx2,バケバケ"), + BATTLE(A(Formation_02), A(pra_01), "バケバケ"), + BATTLE(A(Formation_03), A(pra_01), "バケバケx2"), + BATTLE(A(Formation_04), A(pra_01), "バケバケx3"), + BATTLE(A(Formation_05), A(pra_01), "バケバケx4"), + BATTLE(A(Formation_06), A(pra_01), "バケバケx2,バサバサチュルル"), + BATTLE(A(Formation_07), A(pra_01), "バケバケ,バサバサチュルル,バケバケ"), + BATTLE(A(Formation_08), A(pra_01), "バケバケ,レッドカメック"), + BATTLE(A(Formation_09), A(pra_01), "バケバケx2,レッドカメック"), + BATTLE(A(Formation_0A), A(pra_01), "バケバケ,ホワイトガボン,バケバケ"), + BATTLE(A(Formation_0B), A(pra_01), "バケバケx2,グレイカメック,レッドカメック"), + BATTLE(A(Formation_0C), A(pra_01), "ホワイトガボンx2,バケバケ"), {}, }; -StageList N(Stages) = { - STAGE("pra_01", N(pra_01)), - STAGE("pra_02", N(pra_02)), - STAGE("pra_03", N(pra_03)), - STAGE("pra_03b", N(pra_03b)), - STAGE("pra_03c", N(pra_03c)), - STAGE("pra_04", N(pra_04)), +StageList A(Stages) = { + STAGE("pra_01", A(pra_01)), + STAGE("pra_02", A(pra_02)), + STAGE("pra_03", A(pra_03)), + STAGE("pra_03b", A(pra_03b)), + STAGE("pra_03c", A(pra_03c)), + STAGE("pra_04", A(pra_04)), {}, }; diff --git a/src/battle/area/pra3/area.h b/src/battle/area/pra3/area.h new file mode 100644 index 0000000000..50c8ce7e60 --- /dev/null +++ b/src/battle/area/pra3/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_pra3 diff --git a/src/battle/area/pra3/stage/pra_01.c b/src/battle/area/pra3/stage/pra_01.c index 0deb60a85c..46499345d4 100644 --- a/src/battle/area/pra3/stage/pra_01.c +++ b/src/battle/area/pra3/stage/pra_01.c @@ -1,35 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/pra_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_pra3_pra_01 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(EnableBattleFloorReflections, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o384, - MODEL_o385, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt01_shape", - .hit = "pra_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_pra/pra_01.inc.c" diff --git a/src/battle/area/pra3/stage/pra_02.c b/src/battle/area/pra3/stage/pra_02.c index 4eaf6aeba3..6b8120afc1 100644 --- a/src/battle/area/pra3/stage/pra_02.c +++ b/src/battle/area/pra3/stage/pra_02.c @@ -1,98 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/pra_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_pra3_pra_02 - -EvtScript N(80231B40) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80231C10) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80231CFC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(EnableBattleFloorReflections, TRUE) - EVT_SET(LVar0, 17) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 3000) - EVT_SET(LVar3, 0) - EVT_EXEC(N(80231B40)) - EVT_SET(LVar0, 18) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 3000) - EVT_SET(LVar3, 0) - EVT_EXEC(N(80231B40)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_o383, - MODEL_o384, - MODEL_o385, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt02_shape", - .hit = "pra_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_pra/pra_02.inc.c" diff --git a/src/battle/area/pra3/stage/pra_03.c b/src/battle/area/pra3/stage/pra_03.c index 5795c8afec..0a6ccfba61 100644 --- a/src/battle/area/pra3/stage/pra_03.c +++ b/src/battle/area/pra3/stage/pra_03.c @@ -1,24 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_pra3_pra_03 - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt03_shape", - .hit = "pra_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_pra/pra_03.inc.c" diff --git a/src/battle/area/pra3/stage/pra_03b.c b/src/battle/area/pra3/stage/pra_03b.c index be591405cf..041ecc4bac 100644 --- a/src/battle/area/pra3/stage/pra_03b.c +++ b/src/battle/area/pra3/stage/pra_03b.c @@ -1,25 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_pra3_pra_03b - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 33, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt03_shape", - .hit = "pra_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_pra/pra_03b.inc.c" diff --git a/src/battle/area/pra3/stage/pra_03c.c b/src/battle/area/pra3/stage/pra_03c.c index 65ee39e751..9bf0723701 100644 --- a/src/battle/area/pra3/stage/pra_03c.c +++ b/src/battle/area/pra3/stage/pra_03c.c @@ -1,26 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_pra3_pra_03c - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 33, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 38, MODEL_GROUP_HIDDEN) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt03_shape", - .hit = "pra_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_pra/pra_03c.inc.c" diff --git a/src/battle/area/pra3/stage/pra_04.c b/src/battle/area/pra3/stage/pra_04.c index b2bb344c80..af43aa3b13 100644 --- a/src/battle/area/pra3/stage/pra_04.c +++ b/src/battle/area/pra3/stage/pra_04.c @@ -1,89 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" -#define NAMESPACE b_area_pra3_pra_04 - -EvtScript N(802320D0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802321A0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(8023228C) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 1) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 3000) - EVT_SET(LVar3, 0) - EVT_EXEC(N(802320D0)) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 1) - EVT_SET(LVar2, 3000) - EVT_SET(LVar3, 0) - EVT_EXEC(N(802320D0)) - EVT_CALL(EnableBattleFloorReflections, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "pra_tex", - .shape = "pra_bt04_shape", - .hit = "pra_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_pra/pra_04.inc.c" diff --git a/src/battle/area/sam/actor/duplighost.c b/src/battle/area/sam/actor/duplighost.c index a412f8c860..73800cf8dc 100644 --- a/src/battle/area/sam/actor/duplighost.c +++ b/src/battle/area/sam/actor/duplighost.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_sam_duplighost +#include "../area.h" #include "battle/common/actor/duplighost.inc.c" diff --git a/src/battle/area/sam/actor/frost_piranha.c b/src/battle/area/sam/actor/frost_piranha.c index e0d8e63b37..de2a6891ab 100644 --- a/src/battle/area/sam/actor/frost_piranha.c +++ b/src/battle/area/sam/actor/frost_piranha.c @@ -1,486 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "effects.h" -#include "sprite/npc/LargePiranha.h" +#include "../area.h" -#define NAMESPACE b_area_sam_frost_piranha - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); -extern EvtScript N(attack_bite); -extern EvtScript N(attack_icy_breath); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_LargePiranha_Frost_Anim01, - STATUS_KEY_STONE, ANIM_LargePiranha_Frost_Anim00, - STATUS_KEY_SLEEP, ANIM_LargePiranha_Frost_Anim00, - STATUS_KEY_POISON, ANIM_LargePiranha_Frost_Anim01, - STATUS_KEY_STOP, ANIM_LargePiranha_Frost_Anim00, - STATUS_KEY_STATIC, ANIM_LargePiranha_Frost_Anim00, - STATUS_KEY_PARALYZE, ANIM_LargePiranha_Frost_Anim00, - STATUS_KEY_PARALYZE, ANIM_LargePiranha_Frost_Anim00, - STATUS_KEY_DIZZY, ANIM_LargePiranha_Frost_Anim0F, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_FIRE, -2, - ELEMENT_ICE, 99, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 95, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 85, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 1, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -15, 50 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAG_ICY, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 3, -14 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_FROST_PIRANHA, - .level = 22, - .maxHP = 10, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 70, - .airLiftChance = 20, - .hurricaneChance = 20, - .spookChance = 20, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 90, - .coinReward = 1, - .size = { 60, 52 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -22, 32 }, - .statusTextOffset = { 1, 44 }, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(idle) = { - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_DIZZY) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -27, 33) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 5, -11) - EVT_CALL(N(SetAbsoluteStatusOffsets), -37, 9, -7, 31) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -15, 50) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 3, -14) - EVT_CALL(N(SetAbsoluteStatusOffsets), -22, 32, 1, 44) - EVT_END_IF - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(return_home) = { - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim01) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim10) - EVT_SET_CONST(LVar2, ANIM_LargePiranha_Frost_Anim11) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim10) - EVT_SET_CONST(LVar2, ANIM_LargePiranha_Frost_Anim11) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim11) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(return_home)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim03) - EVT_SET_CONST(LVar2, ANIM_LargePiranha_Frost_Anim0E) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_EXEC_WAIT(N(attack_bite)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_FROZEN) - EVT_EXEC_WAIT(N(attack_bite)) - EVT_RETURN - EVT_END_IF - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 250) - EVT_EXEC_WAIT(N(attack_icy_breath)) - EVT_ELSE - EVT_EXEC_WAIT(N(attack_bite)) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(attack_bite) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim18) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_WAIT(8) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 27) - EVT_SET(LVar1, 0) - EVT_SET(LVar3, LVar0) - EVT_SET(LVar4, LVar1) - EVT_SET(LVar5, LVar2) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar6, LVar7, LVar8) - EVT_ADD(LVar3, LVar6) - EVT_ADD(LVar4, LVar7) - EVT_ADD(LVar5, LVar8) - EVT_DIV(LVar3, 2) - EVT_DIV(LVar4, 2) - EVT_DIV(LVar5, 2) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) - EVT_CALL(SetBattleCamTarget, LVar3, LVar4, LVar5) - EVT_CALL(SetBattleCamZoom, 300) - EVT_CALL(SetBattleCamOffsetZ, 40) - EVT_WAIT(20) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim17) - EVT_WAIT(8) - EVT_ELSE - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, 10) - EVT_ELSE - EVT_ADD(LVar0, 27) - EVT_END_IF - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim01) - EVT_END_IF - EVT_THREAD - EVT_WAIT(8) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DE) - EVT_END_THREAD - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVarA) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim05) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim06) - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim07) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(14) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim18) - EVT_WAIT(10) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim17) - EVT_WAIT(10) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) - EVT_ELSE - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_EXEC_WAIT(N(return_home)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_END_IF - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim05) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim06) - EVT_WAIT(1) - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SET(LVarF, LVar0) - EVT_SWITCH(LVarF) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim07) - EVT_WAIT(20) - EVT_CALL(YieldTurn) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim18) - EVT_WAIT(10) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim17) - EVT_WAIT(10) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) - EVT_ELSE - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_EXEC_WAIT(N(return_home)) - EVT_END_IF - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/UnkEffect6FFunc.inc.c" - -EvtScript N(attack_icy_breath) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, 20) - EVT_ELSE - EVT_ADD(LVar0, 50) - EVT_END_IF - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim01) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim0B) - EVT_WAIT(11) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3AB) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_ADD(LVar0, 12) - EVT_SET(LVar1, 5) - EVT_SETF(LVar3, EVT_FLOAT(0.4)) - EVT_ELSE - EVT_ADD(LVar0, 32) - EVT_SET(LVar1, 13) - EVT_SETF(LVar3, EVT_FLOAT(1.0)) - EVT_END_IF - EVT_CALL(N(UnkEffect6FFunc), LVar2, LVar0, LVar1, LVar2, LVar3, 30, 120, 0, 120) - EVT_WAIT(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim0C) - EVT_WAIT(5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_ICE, STATUS_FLAG_FROZEN, 1, BS_FLAGS1_10) //@bug malformed status word - EVT_SWITCH(LVarA) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim0D) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(14) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_EXEC_WAIT(N(return_home)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_ICE | DAMAGE_TYPE_STATUS_ALWAYS_HITS, SUPPRESS_EVENT_ALL, DMG_STATUS_IGNORE_RES(STATUS_FLAG_FROZEN, 2), 0, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SET(LVarF, LVar0) - EVT_SWITCH(LVarF) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim0D) - EVT_WAIT(20) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_EXEC_WAIT(N(return_home)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/frost_piranha.inc.c" diff --git a/src/battle/area/sam/actor/gray_magikoopa.c b/src/battle/area/sam/actor/gray_magikoopa.c index 9087dbd29f..ccde828baf 100644 --- a/src/battle/area/sam/actor/gray_magikoopa.c +++ b/src/battle/area/sam/actor/gray_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_sam_gray_magikoopa +#include "../area.h" #include "battle/common/actor/gray_magikoopa.inc.c" diff --git a/src/battle/area/sam/actor/gulpit.c b/src/battle/area/sam/actor/gulpit.c index 385bad732d..e90fd56d8b 100644 --- a/src/battle/area/sam/actor/gulpit.c +++ b/src/battle/area/sam/actor/gulpit.c @@ -1,496 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "effects.h" -#include "sprite/npc/Gulpit.h" - -#define NAMESPACE b_area_sam_gulpit - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, -}; - -s32 N(IdleAnimations1)[] = { - STATUS_KEY_NORMAL, ANIM_Gulpit_Anim01, - STATUS_KEY_STONE, ANIM_Gulpit_Anim00, - STATUS_KEY_SLEEP, ANIM_Gulpit_Anim0F, - STATUS_KEY_POISON, ANIM_Gulpit_Anim01, - STATUS_KEY_STOP, ANIM_Gulpit_Anim00, - STATUS_KEY_STATIC, ANIM_Gulpit_Anim01, - STATUS_KEY_PARALYZE, ANIM_Gulpit_Anim00, - STATUS_KEY_DIZZY, ANIM_Gulpit_Anim0E, - STATUS_KEY_FEAR, ANIM_Gulpit_Anim0E, - STATUS_END, -}; - -s32 N(IdleAnimations2)[] = { - STATUS_KEY_NORMAL, ANIM_Gulpit_Anim10, - STATUS_END, -}; - -s32 N(IdleAnimations3)[] = { - STATUS_KEY_NORMAL, ANIM_Gulpit_Anim12, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 60, - STATUS_KEY_POISON, 80, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 10, - STATUS_KEY_PARALYZE, 80, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 85, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -7, 48 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations1), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { -3, -23 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 0 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations2), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 0 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations3), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, 0 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_GULPIT, - .level = 22, - .maxHP = 12, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 60, - .airLiftChance = 50, - .hurricaneChance = 50, - .spookChance = 70, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 53, 50 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -3, 37 }, - .statusTextOffset = { 10, 45 }, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(returnHome) = { - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim01) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0C) - EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim0D) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0C) - EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim0D) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0D) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim01) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim03) - EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim0B) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim03) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(attack_lick) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 80) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim03) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(AddGoalPos, ACTOR_SELF, 10, 0, 0) - EVT_ELSE - EVT_CALL(AddGoalPos, ACTOR_SELF, 20, 0, 0) - EVT_END_IF - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim01) - EVT_WAIT(10) - EVT_THREAD - EVT_WAIT(3) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EE) - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim04) - EVT_WAIT(9) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(15) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_WAIT(10) - EVT_CALL(YieldTurn) - EVT_EXEC_WAIT(N(returnHome)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(attack_rock) = { - EVT_SET(LVarA, LVar0) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(GetActorPos, LVarA, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SUB(LVar2, 1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim02) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim01) - EVT_WAIT(10) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EE) - EVT_CALL(GetActorVar, LVarA, 0, LVar0) - EVT_SET(LVarB, LVar0) - EVT_SWITCH(LVarB) - EVT_CASE_EQ(0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim05) - EVT_WAIT(3) - EVT_CALL(RemoveActor, LVarA) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim06) - EVT_WAIT(15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim07) - EVT_SET(LVarA, 2) - EVT_CASE_EQ(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim08) - EVT_WAIT(3) - EVT_CALL(RemoveActor, LVarA) - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim09) - EVT_WAIT(15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim0A) - EVT_SET(LVarA, 3) - EVT_END_SWITCH - EVT_CALL(SetPartSounds, ACTOR_SELF, LVarA, ACTOR_SOUND_JUMP, 985, 0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVar9, LVar0) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVarA, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 20) - EVT_ADD(LVar2, 2) - EVT_CALL(SetPartPos, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, -100, 0, 5) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, LVarA, EVT_FLOAT(14.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, LVarA, EVT_FLOAT(0.01)) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpPartTo, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2, 0, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVarA, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_IF_EQ(LVar9, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(15) - EVT_CALL(YieldTurn) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVarA, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 20) - EVT_ADD(LVar2, 2) - EVT_CALL(SetPartPos, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, LVarA, EVT_FLOAT(14.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, LVarA, EVT_FLOAT(0.01)) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpPartTo, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2, 0, TRUE) - EVT_SWITCH(LVarA) - EVT_CASE_EQ(2) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 7, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CASE_EQ(3) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 5, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_END_SWITCH - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim01) - EVT_CALL(GetPartOffset, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, -100) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, LVarA, EVT_FLOAT(1.0)) - EVT_CALL(JumpPartTo, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2, 25, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVarA, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_WAIT(10) - EVT_CALL(YieldTurn) - EVT_EXEC_WAIT(N(returnHome)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_EXEC_WAIT(N(attack_lick)) - EVT_RETURN - EVT_END_IF - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_EXEC_WAIT(N(attack_lick)) - EVT_RETURN - EVT_END_IF - EVT_SET(LVarA, 0) - EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_10000) - EVT_CALL(InitTargetIterator) - EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetOriginalActorType, LVar0, LVar2) - EVT_IF_EQ(LVar2, ACTOR_TYPE_GULPIT_ROCKS) - EVT_ADD(LVarA, 1) - EVT_SWITCH(LVarA) - EVT_CASE_EQ(1) - EVT_SET(LVarB, LVar0) - EVT_CASE_EQ(2) - EVT_SET(LVarC, LVar0) - EVT_CASE_EQ(3) - EVT_SET(LVarD, LVar0) - EVT_END_SWITCH - EVT_END_IF - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF - EVT_SWITCH(LVarA) - EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(attack_lick)) - EVT_CASE_EQ(1) - EVT_SET(LVar0, LVarB) - EVT_EXEC_WAIT(N(attack_rock)) - EVT_CASE_EQ(2) - EVT_CALL(RandInt, 1, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_SET(LVar0, LVarB) - EVT_CASE_EQ(1) - EVT_SET(LVar0, LVarC) - EVT_END_SWITCH - EVT_EXEC_WAIT(N(attack_rock)) - EVT_CASE_GE(3) - EVT_CALL(RandInt, 2, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_SET(LVar0, LVarB) - EVT_CASE_EQ(1) - EVT_SET(LVar0, LVarC) - EVT_CASE_EQ(2) - EVT_SET(LVar0, LVarD) - EVT_END_SWITCH - EVT_EXEC_WAIT(N(attack_rock)) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; +#include "../area.h" +#include "battle/common/actor/gulpit.inc.c" diff --git a/src/battle/area/sam/actor/gulpit_rocks.c b/src/battle/area/sam/actor/gulpit_rocks.c index e62e929700..f3812c0197 100644 --- a/src/battle/area/sam/actor/gulpit_rocks.c +++ b/src/battle/area/sam/actor/gulpit_rocks.c @@ -1,190 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "effects.h" -#include "sprite/npc/Gulpit.h" - -#define NAMESPACE b_area_sam_gulpit_rocks - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_Gulpit_Anim10, - STATUS_END, -}; - -s32 N(IdleAnimations2)[] = { - STATUS_KEY_NORMAL, ANIM_Gulpit_Anim12, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 0, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 0, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 0, - STATUS_KEY_SHRINK, 0, - STATUS_KEY_STOP, 0, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 14 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -6 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_NO_SHADOW | ACTOR_FLAG_TARGET_ONLY | ACTOR_FLAG_NO_HEALTH_BAR | ACTOR_FLAG_NO_ATTACK, - .type = ACTOR_TYPE_GULPIT_ROCKS, - .level = 0, - .maxHP = 1, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 0, - .airLiftChance = 100, - .hurricaneChance = 0, - .spookChance = 0, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 0, - .size = { 32, 18 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim10) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetActorSize, ACTOR_SELF, 24, 15) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations2))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim12) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, 1) - EVT_CALL(SetActorSize, ACTOR_SELF, 10, 8) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(setAnim) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_SWITCH(LVarA) - EVT_CASE_EQ(0) - EVT_CASE_EQ(1) - EVT_SET_CONST(LVar1, LVar2) - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_CASE_OR_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim10) - EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim12) - EVT_EXEC_WAIT(N(setAnim)) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim10) - EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim12) - EVT_EXEC_WAIT(N(setAnim)) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(EVENT_BURN_DEATH) - EVT_CASE_OR_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim10) - EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim12) - EVT_EXEC_WAIT(N(setAnim)) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim11) - EVT_CASE_EQ(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim13) - EVT_END_SWITCH - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 1, LVar0, LVar1, LVar2, 0, 0) - EVT_WAIT(30) - EVT_CALL(RemoveActor, ACTOR_SELF) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_RETURN - EVT_END -}; +#include "../area.h" +#include "battle/common/actor/gulpit_rocks.inc.c" diff --git a/src/battle/area/sam/actor/white_clubba.c b/src/battle/area/sam/actor/white_clubba.c index f177e284e2..1a5471d846 100644 --- a/src/battle/area/sam/actor/white_clubba.c +++ b/src/battle/area/sam/actor/white_clubba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_sam_white_clubba +#include "../area.h" #include "battle/common/actor/white_clubba.inc.c" diff --git a/src/battle/area/sam/area.c b/src/battle/area/sam/area.c index 7605690d55..975ba0d391 100644 --- a/src/battle/area/sam/area.c +++ b/src/battle/area/sam/area.c @@ -1,24 +1,21 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_sam +extern ActorBlueprint A(duplighost); +extern ActorBlueprint A(gulpit); +extern ActorBlueprint A(gulpit_rocks); +extern ActorBlueprint A(frost_piranha); +extern ActorBlueprint A(gray_magikoopa); +extern ActorBlueprint A(white_clubba); -extern ActorBlueprint N(duplighost); -extern ActorBlueprint N(gulpit); -extern ActorBlueprint N(gulpit_rocks); -extern ActorBlueprint N(frost_piranha); -extern ActorBlueprint N(gray_magikoopa); -extern ActorBlueprint N(white_clubba); - -extern Stage N(sam_01); -extern Stage N(sam_02); -extern Stage N(sam_02b); -extern Stage N(sam_02c); -extern Stage N(sam_02d); -extern Stage N(sam_03); +extern Stage A(sam_01); +extern Stage A(sam_02); +extern Stage A(sam_02b); +extern Stage A(sam_02c); +extern Stage A(sam_02d); +extern Stage A(sam_03); -Vec3i N(pos_rocks_1)[] = { +Vec3i A(pos_rocks_1)[] = { { -35, 0, -52 }, { -20, 0, -50 }, { -17, 0, -40 }, @@ -26,7 +23,7 @@ Vec3i N(pos_rocks_1)[] = { { -28, 0, -46 }, }; -Vec3i N(pos_rocks_2)[] = { +Vec3i A(pos_rocks_2)[] = { { -35, 0, -52 }, { -20, 0, -50 }, { -17, 0, -40 }, @@ -34,7 +31,7 @@ Vec3i N(pos_rocks_2)[] = { { -28, 0, -46 }, }; -Vec3i N(pos_rocks_3)[] = { +Vec3i A(pos_rocks_3)[] = { { -35, 0, -52 }, { -20, 0, -50 }, { -17, 0, -40 }, @@ -42,7 +39,7 @@ Vec3i N(pos_rocks_3)[] = { { -28, 0, -46 }, }; -Vec3i N(pos_rocks_4)[] = { +Vec3i A(pos_rocks_4)[] = { { -35, 0, -52 }, { -20, 0, -50 }, { -17, 0, -40 }, @@ -50,7 +47,7 @@ Vec3i N(pos_rocks_4)[] = { { -28, 0, -46 }, }; -Vec3i N(pos_rocks_5)[] = { +Vec3i A(pos_rocks_5)[] = { { -35, 0, -52 }, { -20, 0, -50 }, { -17, 0, -40 }, @@ -58,7 +55,7 @@ Vec3i N(pos_rocks_5)[] = { { -28, 0, -46 }, }; -Vec3i N(pos_rocks_6)[] = { +Vec3i A(pos_rocks_6)[] = { { -35, 0, -52 }, { -20, 0, -50 }, { -17, 0, -40 }, @@ -66,7 +63,7 @@ Vec3i N(pos_rocks_6)[] = { { -28, 0, -46 }, }; -Vec3i N(pos_rocks_7)[] = { +Vec3i A(pos_rocks_7)[] = { { -35, 0, -52 }, { -20, 0, -50 }, { -17, 0, -40 }, @@ -74,7 +71,7 @@ Vec3i N(pos_rocks_7)[] = { { -28, 0, -46 }, }; -Vec3i N(pos_rocks_8)[] = { +Vec3i A(pos_rocks_8)[] = { { -35, 0, -52 }, { -20, 0, -50 }, { -17, 0, -40 }, @@ -82,155 +79,155 @@ Vec3i N(pos_rocks_8)[] = { { -28, 0, -46 }, }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(duplighost), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(duplighost), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_B, 20), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_C, 19), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_1)[0], 9), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_1)[1], 8), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_1)[2], 7, 1), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_1)[3], 6), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_1)[4], 5, 1), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_B, 20), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_C, 19), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_1)[0], 9), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_1)[1], 8), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_1)[2], 7, 1), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_1)[3], 6), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_1)[4], 5, 1), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_A, 20), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_B, 19), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_C, 18), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_2)[0], 9), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_2)[1], 8), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_2)[2], 7, 1), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_2)[3], 6), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_2)[4], 5, 1), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_A, 20), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_B, 19), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_C, 18), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_2)[0], 9), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_2)[1], 8), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_2)[2], 7, 1), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_2)[3], 6), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_2)[4], 5, 1), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_A, 20), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_B, 19), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_C, 18), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_3)[0], 9), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_3)[1], 8), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_3)[2], 7, 1), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_3)[3], 6), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_3)[4], 5, 1), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_A, 20), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_B, 19), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_C, 18), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_3)[0], 9), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_3)[1], 8), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_3)[2], 7, 1), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_3)[3], 6), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_3)[4], 5, 1), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_A, 20), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_B, 19), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_C, 18), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_4)[0], 9), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_4)[1], 8), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_4)[2], 7, 1), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_4)[3], 6), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_4)[4], 5, 1), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_A, 20), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_B, 19), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_C, 18), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_4)[0], 9), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_4)[1], 8), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_4)[2], 7, 1), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_4)[3], 6), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_4)[4], 5, 1), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_A, 20), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_B, 19), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_C, 18), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_D, 17), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_5)[0], 9), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_5)[1], 8), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_5)[2], 7, 1), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_5)[3], 6), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_5)[4], 5, 1), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_A, 20), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_B, 19), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_C, 18), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_D, 17), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_5)[0], 9), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_5)[1], 8), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_5)[2], 7, 1), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_5)[3], 6), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_5)[4], 5, 1), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_C, 9), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_D, 7), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_C, 9), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_6)[0], 9), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_6)[1], 8), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_6)[2], 7, 1), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_6)[3], 6), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_6)[4], 5, 1), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_C, 9), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_6)[0], 9), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_6)[1], 8), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_6)[2], 7, 1), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_6)[3], 6), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_6)[4], 5, 1), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_C, 8), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_7)[0], 9), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_7)[1], 8), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_7)[2], 7, 1), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_7)[3], 6), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_7)[4], 5, 1), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_C, 8), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_7)[0], 9), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_7)[1], 8), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_7)[2], 7, 1), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_7)[3], 6), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_7)[4], 5, 1), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(gulpit), BTL_POS_GROUND_D, 7), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_8)[0], 9), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_8)[1], 8), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_8)[2], 7, 1), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_8)[3], 6), - ACTOR_BY_POS(N(gulpit_rocks), N(pos_rocks_8)[4], 5, 1), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(gulpit), BTL_POS_GROUND_D, 7), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_8)[0], 9), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_8)[1], 8), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_8)[2], 7, 1), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_8)[3], 6), + ACTOR_BY_POS(A(gulpit_rocks), A(pos_rocks_8)[4], 5, 1), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_C, 9), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_D, 7), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(frost_piranha), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(white_clubba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(gray_magikoopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(frost_piranha), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(white_clubba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(gray_magikoopa), BTL_POS_GROUND_D, 7), }; -BattleList N(Formations) = { - BATTLE(N(Formation_01), N(sam_01), "バケバケx2"), - BATTLE(N(Formation_02), N(sam_01), "ゴックンx2"), - BATTLE(N(Formation_03), N(sam_01), "ゴックンx3"), - BATTLE(N(Formation_04), N(sam_01), "ゴックンx2,アイスパックン"), - BATTLE(N(Formation_05), N(sam_01), "ゴックン,アイスパックン,ゴックン"), - BATTLE(N(Formation_06), N(sam_01), "ゴックン,アイスパックン,ゴックン,アイスパックン"), - BATTLE(N(Formation_07), N(sam_01), "アイスパックンx2"), - BATTLE(N(Formation_08), N(sam_01), "アイスパックンx4"), - BATTLE(N(Formation_09), N(sam_01), "アイスパックンx2,ゴックン"), - BATTLE(N(Formation_0A), N(sam_01), "アイスパックン,ゴックン,アイスパックン"), - BATTLE(N(Formation_0B), N(sam_01), "アイスパックン,ゴックン,アイスパックン,ゴックン"), - BATTLE(N(Formation_0C), N(sam_01), "ホワイトガボンx2"), - BATTLE(N(Formation_0D), N(sam_01), "ホワイトガボン,パックン,ガボン,パックン"), - BATTLE(N(Formation_0E), N(sam_01), "ホワイトガボン,パックン,ガボン,グレイカメック"), +BattleList A(Formations) = { + BATTLE(A(Formation_01), A(sam_01), "バケバケx2"), + BATTLE(A(Formation_02), A(sam_01), "ゴックンx2"), + BATTLE(A(Formation_03), A(sam_01), "ゴックンx3"), + BATTLE(A(Formation_04), A(sam_01), "ゴックンx2,アイスパックン"), + BATTLE(A(Formation_05), A(sam_01), "ゴックン,アイスパックン,ゴックン"), + BATTLE(A(Formation_06), A(sam_01), "ゴックン,アイスパックン,ゴックン,アイスパックン"), + BATTLE(A(Formation_07), A(sam_01), "アイスパックンx2"), + BATTLE(A(Formation_08), A(sam_01), "アイスパックンx4"), + BATTLE(A(Formation_09), A(sam_01), "アイスパックンx2,ゴックン"), + BATTLE(A(Formation_0A), A(sam_01), "アイスパックン,ゴックン,アイスパックン"), + BATTLE(A(Formation_0B), A(sam_01), "アイスパックン,ゴックン,アイスパックン,ゴックン"), + BATTLE(A(Formation_0C), A(sam_01), "ホワイトガボンx2"), + BATTLE(A(Formation_0D), A(sam_01), "ホワイトガボン,パックン,ガボン,パックン"), + BATTLE(A(Formation_0E), A(sam_01), "ホワイトガボン,パックン,ガボン,グレイカメック"), {}, }; -StageList N(Stages) = { - STAGE("sam_01", N(sam_01)), - STAGE("sam_02", N(sam_02)), - STAGE("sam_02b", N(sam_02b)), - STAGE("sam_02c", N(sam_02c)), - STAGE("sam_02d", N(sam_02d)), - STAGE("sam_03", N(sam_03)), +StageList A(Stages) = { + STAGE("sam_01", A(sam_01)), + STAGE("sam_02", A(sam_02)), + STAGE("sam_02b", A(sam_02b)), + STAGE("sam_02c", A(sam_02c)), + STAGE("sam_02d", A(sam_02d)), + STAGE("sam_03", A(sam_03)), {}, }; diff --git a/src/battle/area/sam/area.h b/src/battle/area/sam/area.h new file mode 100644 index 0000000000..42ad5787ed --- /dev/null +++ b/src/battle/area/sam/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_sam diff --git a/src/battle/area/sam/stage/sam_01.c b/src/battle/area/sam/stage/sam_01.c index 1073050062..50f1c7433a 100644 --- a/src/battle/area/sam/stage/sam_01.c +++ b/src/battle/area/sam/stage/sam_01.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam_sam_01 - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_THREAD - EVT_SET(LVar0, 22) - EVT_SET(LVar1, 1) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 20) - EVT_SET(LVar1, 3) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 18) - EVT_SET(LVar1, 4) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 16) - EVT_SET(LVar1, 2) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_saku, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt01_shape", - .hit = "sam_bt01_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_01.inc.c" diff --git a/src/battle/area/sam/stage/sam_02.c b/src/battle/area/sam/stage/sam_02.c index dc3a6f7ba2..447ca931eb 100644 --- a/src/battle/area/sam/stage/sam_02.c +++ b/src/battle/area/sam/stage/sam_02.c @@ -1,55 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam_sam_02 - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, 10, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 12, MODEL_GROUP_HIDDEN) - EVT_THREAD - EVT_SET(LVar0, 18) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 22) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 24) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_END_THREAD - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_kouri1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt02_shape", - .hit = "sam_bt02_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_02.inc.c" diff --git a/src/battle/area/sam/stage/sam_02b.c b/src/battle/area/sam/stage/sam_02b.c index 5e24da9325..cfe1eac14d 100644 --- a/src/battle/area/sam/stage/sam_02b.c +++ b/src/battle/area/sam/stage/sam_02b.c @@ -1,38 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam_sam_02b - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, 3, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 26, MODEL_GROUP_HIDDEN) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_kouri1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt02_shape", - .hit = "sam_bt02_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_02b.inc.c" diff --git a/src/battle/area/sam/stage/sam_02c.c b/src/battle/area/sam/stage/sam_02c.c index 0cf9fe3888..4c293578c7 100644 --- a/src/battle/area/sam/stage/sam_02c.c +++ b/src/battle/area/sam/stage/sam_02c.c @@ -1,39 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam_sam_02c - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, 3, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 10, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 26, MODEL_GROUP_HIDDEN) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_kouri1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt02_shape", - .hit = "sam_bt02_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_02c.inc.c" diff --git a/src/battle/area/sam/stage/sam_02d.c b/src/battle/area/sam/stage/sam_02d.c index 9486e66667..93ca743918 100644 --- a/src/battle/area/sam/stage/sam_02d.c +++ b/src/battle/area/sam/stage/sam_02d.c @@ -1,40 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam_sam_02d - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, 3, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 10, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 12, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 26, MODEL_GROUP_HIDDEN) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_kouri1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt02_shape", - .hit = "sam_bt02_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_02d.inc.c" diff --git a/src/battle/area/sam/stage/sam_03.c b/src/battle/area/sam/stage/sam_03.c index 49cf059759..f725fd0c54 100644 --- a/src/battle/area/sam/stage/sam_03.c +++ b/src/battle/area/sam/stage/sam_03.c @@ -1,57 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt03_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam_sam_03 - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -void func_8021AE70_626A10(void) { - enable_background_wave(); -} - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_THREAD - EVT_SET(LVar0, 16) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 25) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_NoSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 22) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_NoSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 19) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_NoSpin)) - EVT_END_THREAD - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_o278, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt03_shape", - .hit = "sam_bt03_hit", - .bg = "sam_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_03.inc.c" diff --git a/src/battle/area/sam2/actor/gray_magikoopa.c b/src/battle/area/sam2/actor/gray_magikoopa.c index 293326e28c..ccde828baf 100644 --- a/src/battle/area/sam2/actor/gray_magikoopa.c +++ b/src/battle/area/sam2/actor/gray_magikoopa.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_sam2_gray_magikoopa +#include "../area.h" #include "battle/common/actor/gray_magikoopa.inc.c" diff --git a/src/battle/area/sam2/actor/monstar.c b/src/battle/area/sam2/actor/monstar.c index e86df71793..0cc6fd0cb1 100644 --- a/src/battle/area/sam2/actor/monstar.c +++ b/src/battle/area/sam2/actor/monstar.c @@ -1,12 +1,9 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "effects.h" +#include "../area.h" #include "sprite.h" #include "sprite/npc/Monstar.h" #include "battle/area/sam2/actor/img.png.h" -#define NAMESPACE b_area_sam2_monstar +#define NAMESPACE A(monstar) extern Gfx N(dlist)[]; @@ -239,7 +236,7 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP @@ -253,7 +250,7 @@ EvtScript N(handleEvent) = { EVT_SET(LVar1, ANIM_Monstar_Hurt) EVT_SET(LVar2, -1) EVT_EXEC_WAIT(N(OnBurn)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_Hurt) EVT_EXEC_WAIT(N(OnDeath)) EVT_RETURN @@ -261,10 +258,10 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_Idle1) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_GatherStrength1) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) @@ -272,34 +269,34 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_Idle1) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_GatherStrength1) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_Hurt) EVT_EXEC_WAIT(N(OnDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_Idle1) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_Idle1) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_GatherStrength1) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_AirLift) @@ -307,10 +304,10 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_Idle1) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Monstar_GatherStrength1) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) diff --git a/src/battle/area/sam2/actor/paragoomba.c b/src/battle/area/sam2/actor/paragoomba.c index 4ae20e68c5..2d2fefd360 100644 --- a/src/battle/area/sam2/actor/paragoomba.c +++ b/src/battle/area/sam2/actor/paragoomba.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_sam2_paragoomba +#include "../area.h" #include "battle/common/actor/paragoomba.inc.c" diff --git a/src/battle/area/sam2/area.c b/src/battle/area/sam2/area.c index a27573b674..22f5c9153c 100644 --- a/src/battle/area/sam2/area.c +++ b/src/battle/area/sam2/area.c @@ -1,42 +1,39 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_sam2 +extern ActorBlueprint A(monstar); +extern ActorBlueprint A(paragoomba); +extern ActorBlueprint A(gray_magikoopa); -extern ActorBlueprint N(monstar); -extern ActorBlueprint N(paragoomba); -extern ActorBlueprint N(gray_magikoopa); +extern Stage A(sam_01); +extern Stage A(sam_02); +extern Stage A(sam_02b); +extern Stage A(sam_02c); +extern Stage A(sam_02d); +extern Stage A(sam_03); -extern Stage N(sam_01); -extern Stage N(sam_02); -extern Stage N(sam_02b); -extern Stage N(sam_02c); -extern Stage N(sam_02d); -extern Stage N(sam_03); +Vec3i A(MonstarPos) = { 75, 16, 5 }; -Vec3i N(80223490) = { 75, 16, 5 }; - -Formation N(Formation_01) = { - ACTOR_BY_POS(N(monstar), N(80223490), 10), +Formation A(Formation_01) = { + ACTOR_BY_POS(A(monstar), A(MonstarPos), 10), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(paragoomba), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(gray_magikoopa), BTL_POS_GROUND_C, 9), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(paragoomba), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(gray_magikoopa), BTL_POS_GROUND_C, 9), }; -BattleList N(Formations) = { - BATTLE(N(Formation_01), N(sam_03), "かいぶつ"), - BATTLE(N(Formation_02), N(sam_01), "パタクリ,グレイカメック(チェックよう)"), +BattleList A(Formations) = { + BATTLE(A(Formation_01), A(sam_03), "かいぶつ"), + BATTLE(A(Formation_02), A(sam_01), "パタクリ,グレイカメック(チェックよう)"), {}, }; -StageList N(Stages) = { - STAGE("sam_01", N(sam_01)), - STAGE("sam_02", N(sam_02)), - STAGE("sam_02b", N(sam_02b)), - STAGE("sam_02c", N(sam_02c)), - STAGE("sam_02d", N(sam_02d)), - STAGE("sam_03", N(sam_03)), +StageList A(Stages) = { + STAGE("sam_01", A(sam_01)), + STAGE("sam_02", A(sam_02)), + STAGE("sam_02b", A(sam_02b)), + STAGE("sam_02c", A(sam_02c)), + STAGE("sam_02d", A(sam_02d)), + STAGE("sam_03", A(sam_03)), {}, }; diff --git a/src/battle/area/sam2/area.h b/src/battle/area/sam2/area.h new file mode 100644 index 0000000000..55b30e0f9e --- /dev/null +++ b/src/battle/area/sam2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_sam2 diff --git a/src/battle/area/sam2/dlist.c b/src/battle/area/sam2/dlist.c index e08d455741..a070dad3e8 100644 --- a/src/battle/area/sam2/dlist.c +++ b/src/battle/area/sam2/dlist.c @@ -1,6 +1,6 @@ -#include "common.h" +#include "area.h" -#define NAMESPACE b_area_sam2_monstar +#define NAMESPACE A(monstar) extern Vtx monstar_bubbles[66]; diff --git a/src/battle/area/sam2/stage/sam_01.c b/src/battle/area/sam2/stage/sam_01.c index c4051d0816..50f1c7433a 100644 --- a/src/battle/area/sam2/stage/sam_01.c +++ b/src/battle/area/sam2/stage/sam_01.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt01_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam2_sam_01 - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_THREAD - EVT_SET(LVar0, 22) - EVT_SET(LVar1, 1) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 20) - EVT_SET(LVar1, 3) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 18) - EVT_SET(LVar1, 4) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 16) - EVT_SET(LVar1, 2) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_saku, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt01_shape", - .hit = "sam_bt01_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_01.inc.c" diff --git a/src/battle/area/sam2/stage/sam_02.c b/src/battle/area/sam2/stage/sam_02.c index 34c9284d2d..447ca931eb 100644 --- a/src/battle/area/sam2/stage/sam_02.c +++ b/src/battle/area/sam2/stage/sam_02.c @@ -1,55 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam2_sam_02 - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, 10, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 12, MODEL_GROUP_HIDDEN) - EVT_THREAD - EVT_SET(LVar0, 18) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 22) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 24) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_END_THREAD - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_kouri1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt02_shape", - .hit = "sam_bt02_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_02.inc.c" diff --git a/src/battle/area/sam2/stage/sam_02b.c b/src/battle/area/sam2/stage/sam_02b.c index 229d4d2d7e..cfe1eac14d 100644 --- a/src/battle/area/sam2/stage/sam_02b.c +++ b/src/battle/area/sam2/stage/sam_02b.c @@ -1,38 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam2_sam_02b - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, 3, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 26, MODEL_GROUP_HIDDEN) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_kouri1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt02_shape", - .hit = "sam_bt02_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_02b.inc.c" diff --git a/src/battle/area/sam2/stage/sam_02c.c b/src/battle/area/sam2/stage/sam_02c.c index 1c2b2067a1..4c293578c7 100644 --- a/src/battle/area/sam2/stage/sam_02c.c +++ b/src/battle/area/sam2/stage/sam_02c.c @@ -1,39 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam2_sam_02c - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, 3, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 10, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 26, MODEL_GROUP_HIDDEN) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_kouri1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt02_shape", - .hit = "sam_bt02_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_02c.inc.c" diff --git a/src/battle/area/sam2/stage/sam_02d.c b/src/battle/area/sam2/stage/sam_02d.c index b4b7b3d658..93ca743918 100644 --- a/src/battle/area/sam2/stage/sam_02d.c +++ b/src/battle/area/sam2/stage/sam_02d.c @@ -1,40 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt02_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam2_sam_02d - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetGroupVisibility, 3, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 10, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 12, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 26, MODEL_GROUP_HIDDEN) - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_kouri1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt02_shape", - .hit = "sam_bt02_hit", - .bg = "yki_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_02d.inc.c" diff --git a/src/battle/area/sam2/stage/sam_03.c b/src/battle/area/sam2/stage/sam_03.c index 8588687cf2..f725fd0c54 100644 --- a/src/battle/area/sam2/stage/sam_03.c +++ b/src/battle/area/sam2/stage/sam_03.c @@ -1,57 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "mapfs/sam_bt03_shape.h" +#include "../area.h" -#define NAMESPACE b_area_sam2_sam_03 - -#include "battle/common/stage/lib/Snowflakes.inc.c" - -void func_80219E40_63F020(void) { - enable_background_wave(); -} - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_THREAD - EVT_SET(LVar0, 16) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 25) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_NoSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 22) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_NoSpin)) - EVT_WAIT(5) - EVT_SET(LVar0, 19) - EVT_SET(LVar1, 0) - EVT_EXEC(N(EVS_AnimateHangingSnowflake_NoSpin)) - EVT_END_THREAD - EVT_EXEC(N(EVS_SpawnSnowfall)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - -1, - MODEL_o278, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sam_tex", - .shape = "sam_bt03_shape", - .hit = "sam_bt03_hit", - .bg = "sam_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sam/sam_03.inc.c" diff --git a/src/battle/area/sam2/vtx.c b/src/battle/area/sam2/vtx.c index 25755dbfa9..39b8914cb9 100644 --- a/src/battle/area/sam2/vtx.c +++ b/src/battle/area/sam2/vtx.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_sam2 +#include "area.h" #include "battle/area/sam2/monstar_bubbles.vtx.inc.c" diff --git a/src/battle/area/sbk/actor/bandit.c b/src/battle/area/sbk/actor/bandit.c index aa2f91bd13..4d4a335670 100644 --- a/src/battle/area/sbk/actor/bandit.c +++ b/src/battle/area/sbk/actor/bandit.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_sbk_bandit +#include "../area.h" #include "battle/common/actor/bandit.inc.c" diff --git a/src/battle/area/sbk/actor/pokey.c b/src/battle/area/sbk/actor/pokey.c index 297735ed57..907725b1c3 100644 --- a/src/battle/area/sbk/actor/pokey.c +++ b/src/battle/area/sbk/actor/pokey.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_sbk_pokey +#include "../area.h" #include "battle/common/actor/pokey.inc.c" diff --git a/src/battle/area/sbk/area.c b/src/battle/area/sbk/area.c index d58a7a17c5..0ec0064002 100644 --- a/src/battle/area/sbk/area.c +++ b/src/battle/area/sbk/area.c @@ -1,134 +1,131 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_sbk +extern ActorBlueprint A(pokey); +extern ActorBlueprint A(bandit); -extern ActorBlueprint N(pokey); -extern ActorBlueprint N(bandit); +extern Stage A(sbk_02); -extern Stage N(sbk_02); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 10), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_C, 9), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_C, 8), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_D, 7), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_C, 9), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_C, 8), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_D, 7), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_C, 8), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_D, 7), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_B, 10), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_B, 10), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_C, 9), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_C, 8), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_D, 7), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_C, 9), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_C, 8), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_D, 7), +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(pokey), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(bandit), BTL_POS_GROUND_C, 8), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(pokey), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(bandit), BTL_POS_GROUND_C, 8), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(sbk_02), "サンボ"), - BATTLE(N(Formation_01), N(sbk_02), "サンボx2"), - BATTLE(N(Formation_02), N(sbk_02), "サンボx3"), - BATTLE(N(Formation_03), N(sbk_02), "きいろサンボx4"), - BATTLE(N(Formation_04), N(sbk_02), "サンボ,ボロドー"), - BATTLE(N(Formation_05), N(sbk_02), "サンボx2,ボロドー"), - BATTLE(N(Formation_06), N(sbk_02), "サンボx2,ボロドーx2"), - BATTLE(N(Formation_07), N(sbk_02), "サンボ,ボロドー,サンボ"), - BATTLE(N(Formation_08), N(sbk_02), "サンボx2,ボロドー,サンボ"), - BATTLE(N(Formation_09), N(sbk_02), "ボロドー"), - BATTLE(N(Formation_0A), N(sbk_02), "ボロドーx2"), - BATTLE(N(Formation_0B), N(sbk_02), "ボロドーx3"), - BATTLE(N(Formation_0C), N(sbk_02), "ボロドーx4"), - BATTLE(N(Formation_0D), N(sbk_02), "ボロドー,サンボ"), - BATTLE(N(Formation_0E), N(sbk_02), "ボロドーx2,サンボ"), - BATTLE(N(Formation_0F), N(sbk_02), "ボロドーx2,サンボx2"), - BATTLE(N(Formation_10), N(sbk_02), "ボロドー,サンボ,ボロドー"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(sbk_02), "サンボ"), + BATTLE(A(Formation_01), A(sbk_02), "サンボx2"), + BATTLE(A(Formation_02), A(sbk_02), "サンボx3"), + BATTLE(A(Formation_03), A(sbk_02), "きいろサンボx4"), + BATTLE(A(Formation_04), A(sbk_02), "サンボ,ボロドー"), + BATTLE(A(Formation_05), A(sbk_02), "サンボx2,ボロドー"), + BATTLE(A(Formation_06), A(sbk_02), "サンボx2,ボロドーx2"), + BATTLE(A(Formation_07), A(sbk_02), "サンボ,ボロドー,サンボ"), + BATTLE(A(Formation_08), A(sbk_02), "サンボx2,ボロドー,サンボ"), + BATTLE(A(Formation_09), A(sbk_02), "ボロドー"), + BATTLE(A(Formation_0A), A(sbk_02), "ボロドーx2"), + BATTLE(A(Formation_0B), A(sbk_02), "ボロドーx3"), + BATTLE(A(Formation_0C), A(sbk_02), "ボロドーx4"), + BATTLE(A(Formation_0D), A(sbk_02), "ボロドー,サンボ"), + BATTLE(A(Formation_0E), A(sbk_02), "ボロドーx2,サンボ"), + BATTLE(A(Formation_0F), A(sbk_02), "ボロドーx2,サンボx2"), + BATTLE(A(Formation_10), A(sbk_02), "ボロドー,サンボ,ボロドー"), {}, }; -StageList N(Stages) = { - STAGE("sbk_01", N(sbk_02)), +StageList A(Stages) = { + STAGE("sbk_01", A(sbk_02)), {}, }; diff --git a/src/battle/area/sbk/area.h b/src/battle/area/sbk/area.h new file mode 100644 index 0000000000..6de2eadff8 --- /dev/null +++ b/src/battle/area/sbk/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_sbk diff --git a/src/battle/area/sbk/stage/sbk_02.c b/src/battle/area/sbk/stage/sbk_02.c index 538be27d1d..bff3d51efa 100644 --- a/src/battle/area/sbk/stage/sbk_02.c +++ b/src/battle/area/sbk/stage/sbk_02.c @@ -1,67 +1,3 @@ -#include "common.h" -#include "effects.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" -#define NAMESPACE b_area_sbk_sbk_02 - -#include "common/UpdateSunPos.inc.c" - -#include "common/GetModelPos.inc.c" - -EvtScript N(8021F720) = { - EVT_SET(LVarA, LVar0) - EVT_SET(LVar7, LVar1) - EVT_MUL(LVar7, 10) - EVT_CALL(N(GetModelPos)) - EVT_LABEL(0) - EVT_ADD(LVar7, 1) - EVT_IF_GT(LVar7, 3599) - EVT_SUB(LVar7, 3600) - EVT_END_IF - EVT_CALL(N(UpdateSunPos), LVar7, LVar0, LVar1, LVar2) - EVT_CALL(TranslateModel, LVarA, LVar0, LVar1, LVar2) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_SET(LVar0, 1) - EVT_SET(LVar1, 0) - EVT_EXEC(N(8021F720)) - EVT_SET(LVar0, 3) - EVT_SET(LVar1, 120) - EVT_EXEC(N(8021F720)) - EVT_SET(LVar0, 5) - EVT_SET(LVar1, 240) - EVT_EXEC(N(8021F720)) - EVT_PLAY_EFFECT(EFFECT_SUN, 0, 0, 0, 0, 0, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - 0x00000028, - 0x00000027, - 0x00000026, - 0x00000025, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "sbk_tex", - .shape = "sbk_bt02_shape", - .hit = "sbk_bt02_hit", - .bg = "sbk_bg", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "battle/common/stage/area_sbk/sbk_02.inc.c" diff --git a/src/battle/area/tik/actor/buzzy_beetle.c b/src/battle/area/tik/actor/buzzy_beetle.c index 13f5ac6407..fabefe45d4 100644 --- a/src/battle/area/tik/actor/buzzy_beetle.c +++ b/src/battle/area/tik/actor/buzzy_beetle.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_tik_buzzy_beetle +#include "../area.h" #include "battle/common/actor/buzzy_beetle.inc.c" diff --git a/src/battle/area/tik/actor/dark_koopa.c b/src/battle/area/tik/actor/dark_koopa.c index 755f3c4ec8..da0ecfbc73 100644 --- a/src/battle/area/tik/actor/dark_koopa.c +++ b/src/battle/area/tik/actor/dark_koopa.c @@ -1,891 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/KoopaTroopa.h" -#include "effects.h" - -#define NAMESPACE b_area_tik_dark_koopa - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -extern s32 N(IdleAnimations)[]; - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 2, - ELEMENT_SMASH, 2, - ELEMENT_JUMP, 2, - ELEMENT_WATER, 2, - ELEMENT_BLAST, 2, - ELEMENT_END, -}; - -s32 N(DefenseTable_Flipped)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 80, - STATUS_KEY_POISON, 60, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 80, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -2, 36 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAG_FLIPABLE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -7 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_DARK_KOOPA, - .level = 18, - .maxHP = 8, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 60, - .airLiftChance = 85, - .hurricaneChance = 75, - .spookChance = 70, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 90, - .coinReward = 2, - .size = { 28, 36 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -15, 32 }, - .statusTextOffset = { 5, 32 }, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Idle, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Idle, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Idle, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations_step)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations_active)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Scramble, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Scramble, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Scramble, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations_step_active)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations_flipped)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_ToppleStruggle, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_ToppleStill, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_ToppleSleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_ToppleStruggle, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_ToppleStill, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_ToppleStruggle, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_ToppleStill, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_ToppleStunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_ToppleStunned, - STATUS_END, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 300) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_ELSE - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) - EVT_END_IF - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_RETURN - EVT_END -}; - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(updateOffsets) = { - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_IF_FLAG(LVar1, STATUS_FLAG_SLEEP | STATUS_FLAG_DIZZY) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) - EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 32, 5, 32) - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_LABEL(0) - EVT_CALL(RandInt, 80, LVarA) - EVT_ADD(LVarA, 80) - EVT_LOOP(LVarA) - EVT_LABEL(1) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(updateOffsets)) - EVT_IF_EQ(LVar0, 2) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_IF_EQ(LVar0, 3) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step_active))) - EVT_END_SWITCH - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_LOOP(20) - EVT_LABEL(2) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(updateOffsets)) - EVT_IF_EQ(LVar0, 2) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_IF_EQ(LVar0, 3) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step_active))) - EVT_END_SWITCH - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_LOOP(50) - EVT_LABEL(3) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(updateOffsets)) - EVT_IF_EQ(LVar0, 2) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_IF_EQ(LVar0, 3) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) - EVT_THREAD - EVT_CALL(MakeLerp, 720, 0, 30, EASING_COS_IN_OUT) - EVT_LABEL(10) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar1, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar2) - EVT_IF_EQ(LVar2, 1) - EVT_WAIT(1) - EVT_GOTO(10) - EVT_END_IF - EVT_END_IF - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_END_THREAD - EVT_WAIT(8) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 1, ACTOR_DECORATION_WHIRLWIND) - EVT_WAIT(15) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) - EVT_WAIT(8) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_CASE_EQ(0) - EVT_CASE_EQ(2) - EVT_CASE_EQ(3) - EVT_END_SWITCH - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -s32 N(FlipPosOffsets)[] = { 9, 16, 22, 26, 30, 32, 33, 32, 30, 26, 22, 16, 9, 0, 4, 6, 7, 6, 4, 0, 2, 0 }; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_END_IF - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 2) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 3) - EVT_END_SWITCH - EVT_CALL(SetActorVar, ACTOR_SELF, 9, 1) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Hurt) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) - EVT_THREAD - EVT_WAIT(4) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 30) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -30) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -60) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -75) - EVT_WAIT(1) - EVT_END_THREAD - EVT_USE_BUF(N(FlipPosOffsets)) - EVT_LOOP(ARRAY_COUNT(N(FlipPosOffsets))) - EVT_BUF_READ1(LVar0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ShellEnter) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_WAIT(10) - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_END_IF - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Scramble) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_END_IF - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Panic) - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Panic) - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(attackShellToss) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) - EVT_ELSE - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 4) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(3) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) - EVT_WAIT(10) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_END_IF - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D3) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, 3, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) - EVT_CALL(AddGoalPos, ACTOR_SELF, -40, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_WAIT(8) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_WAIT(4) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic1) - EVT_WAIT(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic2) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) - EVT_WAIT(6) - EVT_SUB(LVar1, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_WAIT(8) - EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(attackDizzyTornado) = { - EVT_LABEL(10) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar0, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(AddGoalPos, ACTOR_SELF, 8, 0, 0) - EVT_ELSE - EVT_CALL(AddGoalPos, ACTOR_SELF, 20, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Run) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 4) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(3) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) - EVT_WAIT(20) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2026) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 1, ACTOR_DECORATION_WHIRLWIND) - EVT_WAIT(40) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, 0, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) - EVT_WAIT(10) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, SUPPRESS_EVENT_ALL, DMG_STATUS_KEY(STATUS_FLAG_DIZZY, 2, 60), 0, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_THREAD - EVT_CALL(WasStatusInflicted, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(MakeLerp, 0, 0x00000438, 30, EASING_COS_IN_OUT) - EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF - EVT_END_IF - EVT_END_THREAD - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) - EVT_WAIT(10) - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(standUp) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetActorVar, ACTOR_SELF, 9, LVar0) - EVT_SUB(LVar0, 1) - EVT_IF_GT(LVar0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 9, LVar0) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_WAIT(30) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_ELSE - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_WAIT(20) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_JUMP_3E2) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_SET(LVar0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) - EVT_THREAD - EVT_LOOP(5) - EVT_ADD(LVar0, 15) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20BA) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(2) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CASE_EQ(3) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) - EVT_END_SWITCH - EVT_END_IF - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(attackShellToss)) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 300) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_ELSE - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) - EVT_END_IF - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(attackDizzyTornado)) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 300) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_ELSE - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) - EVT_END_IF - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_EXEC_WAIT(N(standUp)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; +#include "../area.h" +#include "battle/common/actor/dark_koopa.inc.c" diff --git a/src/battle/area/tik/actor/dark_paratroopa.c b/src/battle/area/tik/actor/dark_paratroopa.c index 2379175fe3..f94afab578 100644 --- a/src/battle/area/tik/actor/dark_paratroopa.c +++ b/src/battle/area/tik/actor/dark_paratroopa.c @@ -1,1443 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/ParaTroopa.h" -#include "sprite/npc/KoopaTroopa.h" -#include "effects.h" - -#define NAMESPACE b_area_tik_dark_paratroopa - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); -extern EvtScript N(nextTurn); -extern EvtScript N(fall); -extern EvtScript N(init_koopa); -extern EvtScript N(takeTurn_koopa); -extern EvtScript N(idle_koopa); -extern EvtScript N(handleEvent_koopa); - -extern s32 N(IdleAnimations)[]; -extern s32 N(IdleAnimations2)[]; -extern s32 N(IdleAnimations3)[]; - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 2, - ELEMENT_SMASH, 2, - ELEMENT_JUMP, 2, - ELEMENT_WATER, 2, - ELEMENT_BLAST, 2, - ELEMENT_END, -}; - -s32 N(defenseTable2)[] = { - ELEMENT_NORMAL, 2, - ELEMENT_END, -}; - -s32 N(DefenseTable_koopa_flipped)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_koopa)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 80, - STATUS_KEY_POISON, 60, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 50, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 80, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, -1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 80, - STATUS_KEY_POISON, 60, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 80, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 75, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 1, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -2, 36 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAG_FLIPABLE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -7 }, - }, - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -4, 36 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations2), - .defenseTable = N(defenseTable2), - .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 2, -14 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 32 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations3), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_FLYING, - .type = ACTOR_TYPE_DARK_PARATROOPA, - .level = 18, - .maxHP = 8, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 50, - .airLiftChance = 90, - .hurricaneChance = 80, - .spookChance = 70, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 85, - .coinReward = 2, - .size = { 50, 38 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 29 }, - .statusTextOffset = { 8, 30 }, -}; - -s32 N(IdleAnimations2)[] = { - STATUS_KEY_NORMAL, ANIM_ParaTroopa_Dark_Idle, - STATUS_KEY_STONE, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_ParaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_STOP, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_ParaTroopa_Dark_Idle, - STATUS_KEY_PARALYZE, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_ParaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_ParaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations_step)[] = { - STATUS_KEY_NORMAL, ANIM_ParaTroopa_Dark_Idle, - STATUS_KEY_STONE, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_ParaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_STOP, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_ParaTroopa_Dark_Idle, - STATUS_KEY_PARALYZE, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_ParaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_ParaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations3)[] = { - STATUS_KEY_NORMAL, ANIM_ParaTroopa_Dark_WingsStill, - STATUS_KEY_STONE, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_ParaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_STOP, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_ParaTroopa_Dark_WingsStill, - STATUS_KEY_PARALYZE, ANIM_ParaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_ParaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_ParaTroopa_Dark_Stunned, - STATUS_END, -}; - -EvtScript N(nextTurn) = { - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_RETURN - EVT_END -}; - -#include "common/StartRumbleWithParams.inc.c" -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(updateOffsets) = { - EVT_IF_FLAG(LVar1, STATUS_FLAG_SLEEP | STATUS_FLAG_DIZZY) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_2, 0, 25) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_2, 3, -6) - EVT_CALL(N(SetAbsoluteStatusOffsets), -19, 25, 4, 28) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_2, -2, 36) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_2, 0, -7) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 29, 8, 30) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(updateOffsets)) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_step))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations2))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(updateOffsets)) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_step))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations2))) - EVT_LOOP(40) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(updateOffsets)) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(returnHome) = { - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Idle) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(GetEncounterState, LVar0) - EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) - EVT_EXEC_WAIT(N(fall)) - EVT_END_IF - EVT_END_IF - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_ParaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_ParaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_FALL_TRIGGER) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_EXEC_WAIT(N(fall)) - EVT_CASE_EQ(EVENT_15) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnHurt) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(fall)) - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_ShellEnter) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_ShellEnter) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(GetEncounterState, LVar0) - EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) - EVT_EXEC_WAIT(N(fall)) - EVT_END_IF - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) - EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) - EVT_CALL(HPBarToCurrent, ACTOR_SELF) - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Run) - EVT_SET_CONST(LVar2, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_05) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 40, 30, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -16, EASING_LINEAR) - EVT_CALL(UseBattleCamPresetImmediately, BTL_CAM_PRESET_01) - EVT_WAIT(5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Windup) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(AddGoalPos, ACTOR_SELF, 6, 6, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) - EVT_WAIT(6) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 25) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(10.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_ShellDive) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) - EVT_SET(LVar0, 0) - EVT_LOOP(8) - EVT_ADD(LVar0, 90) - EVT_IF_GE(LVar0, 360) - EVT_SUB(LVar0, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, -10, 0) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Hurt) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Hurt) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 30) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_WAIT(20) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Windup) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(AddGoalPos, ACTOR_SELF, 6, 6, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) - EVT_WAIT(6) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(10.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_ShellDive) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 40, 30, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_ShellHit) - EVT_THREAD - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) - EVT_SET(LVar0, 0) - EVT_LOOP(12) - EVT_SUB(LVar0, 90) - EVT_IF_LT(LVar0, 0) - EVT_ADD(LVar0, 360) - EVT_END_IF - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, -10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Idle) - EVT_END_THREAD - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 30, EASING_LINEAR) - EVT_WAIT(10) - EVT_CALL(YieldTurn) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_EXEC_WAIT(N(returnHome)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(fall) = { - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, 0, 0, 0) - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 8) - EVT_SUB(LVar2, 2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Hurt) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_EQ(LVarA, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 128, 7) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) - EVT_END_THREAD - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_LOOP(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_ELSE - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_THREAD - EVT_LOOP(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_END_THREAD - EVT_CALL(N(StartRumbleWithParams), 150, 7) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) - EVT_END_THREAD - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_END_IF - EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) - EVT_MOD(LVar0, 4) - EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_koopa))) - EVT_CALL(BindNextTurn, ACTOR_SELF, 0) - EVT_EXEC_WAIT(N(init_koopa)) - EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_DARK_KOOPA) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_IF_NE(LVarA, 0) - EVT_CALL(DispatchEvent, ACTOR_SELF, EVENT_FLIP_TRIGGER) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Idle, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Idle, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Idle, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations_koopa_step)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations_koopa_active)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Scramble, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Scramble, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Scramble, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations_koopa_step_active)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, - STATUS_END, -}; - -s32 N(IdleAnimations_koopa_flipped)[] = { - STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_ToppleStruggle, - STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_ToppleStill, - STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_ToppleSleep, - STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_ToppleStruggle, - STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_ToppleStill, - STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_ToppleStruggle, - STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_ToppleStill, - STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_ToppleStunned, - STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_ToppleStunned, - STATUS_END, -}; - -EvtScript N(init_koopa) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_koopa))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_koopa))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_koopa))) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 300) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_ELSE - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) - EVT_END_IF - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(updateOffsets_koopa) = { - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_IF_FLAG(LVar1, STATUS_FLAG_SLEEP | STATUS_FLAG_DIZZY) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) - EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 32, 5, 32) - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_koopa) = { - EVT_LABEL(0) - EVT_CALL(RandInt, 80, LVarA) - EVT_ADD(LVarA, 80) - EVT_LOOP(LVarA) - EVT_LABEL(1) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(updateOffsets_koopa)) - EVT_IF_EQ(LVar0, 2) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_IF_EQ(LVar0, 3) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_step))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_step_active))) - EVT_END_SWITCH - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_flipped))) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_LOOP(20) - EVT_LABEL(2) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(updateOffsets_koopa)) - EVT_IF_EQ(LVar0, 2) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_IF_EQ(LVar0, 3) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_step))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_step_active))) - EVT_END_SWITCH - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_flipped))) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_LOOP(50) - EVT_LABEL(3) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(updateOffsets_koopa)) - EVT_IF_EQ(LVar0, 2) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_IF_EQ(LVar0, 3) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) - EVT_THREAD - EVT_CALL(MakeLerp, 720, 0, 30, EASING_COS_IN_OUT) - EVT_LABEL(10) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar1, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar2) - EVT_IF_EQ(LVar2, 1) - EVT_WAIT(1) - EVT_GOTO(10) - EVT_END_IF - EVT_END_IF - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_END_THREAD - EVT_WAIT(8) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 1, ACTOR_DECORATION_WHIRLWIND) - EVT_WAIT(15) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) - EVT_WAIT(8) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_CASE_EQ(0) - EVT_CASE_EQ(2) - EVT_CASE_EQ(3) - EVT_END_SWITCH - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -s32 N(FlipPosOffsets)[] = { 9, 16, 22, 26, 30, 32, 33, 32, 30, 26, 22, 16, 9, 0, 4, 6, 7, 6, 4, 0, 2, 0 }; - -EvtScript N(handleEvent_koopa) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) - EVT_END_IF - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 2) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 3) - EVT_END_SWITCH - EVT_CALL(SetActorVar, ACTOR_SELF, 9, 1) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_koopa_flipped))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_flipped))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Hurt) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) - EVT_THREAD - EVT_WAIT(4) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 30) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -30) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -60) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -75) - EVT_WAIT(1) - EVT_END_THREAD - EVT_USE_BUF(N(FlipPosOffsets)) - EVT_LOOP(ARRAY_COUNT(N(FlipPosOffsets))) - EVT_BUF_READ1(LVar0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ShellEnter) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_WAIT(10) - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_END_IF - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Scramble) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_END_IF - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Panic) - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Panic) - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(0) - EVT_CASE_OR_EQ(1) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(koopa_attackShellToss) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) - EVT_ELSE - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 4) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(3) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) - EVT_WAIT(10) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_END_IF - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D3) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, 3, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) - EVT_CALL(AddGoalPos, ACTOR_SELF, -40, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_WAIT(8) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_WAIT(4) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic1) - EVT_WAIT(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic2) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) - EVT_WAIT(6) - EVT_SUB(LVar1, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_WAIT(8) - EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(koopa_attackDizzyTornado) = { - EVT_LABEL(10) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar0, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(AddGoalPos, ACTOR_SELF, 8, 0, 0) - EVT_ELSE - EVT_CALL(AddGoalPos, ACTOR_SELF, 20, 0, 0) - EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Run) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) - EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter) - EVT_WAIT(10) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 4) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(3) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_WAIT(2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) - EVT_END_THREAD - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) - EVT_WAIT(20) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2026) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 1, ACTOR_DECORATION_WHIRLWIND) - EVT_WAIT(40) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, 0, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) - EVT_WAIT(10) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_WAIT(2) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, SUPPRESS_EVENT_ALL, DMG_STATUS_KEY(STATUS_FLAG_DIZZY, 2, 60), 0, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_THREAD - EVT_CALL(WasStatusInflicted, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(MakeLerp, 0, 0x00000438, 30, EASING_COS_IN_OUT) - EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorYaw, ACTOR_PLAYER, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF - EVT_END_IF - EVT_END_THREAD - EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) - EVT_WAIT(10) - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(koopa_standUp) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetActorVar, ACTOR_SELF, 9, LVar0) - EVT_SUB(LVar0, 1) - EVT_IF_GT(LVar0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 9, LVar0) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_WAIT(30) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_ELSE - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_WAIT(20) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_JUMP_3E2) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle) - EVT_SET(LVar0, 0) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) - EVT_THREAD - EVT_LOOP(5) - EVT_ADD(LVar0, 15) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20BA) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(2) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CASE_EQ(3) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) - EVT_END_SWITCH - EVT_END_IF - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn_koopa) = { - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(koopa_attackShellToss)) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 300) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_ELSE - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) - EVT_END_IF - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(koopa_attackDizzyTornado)) - EVT_CALL(RandInt, 1000, LVar0) - EVT_IF_LT(LVar0, 300) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_ELSE - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) - EVT_END_IF - EVT_CASE_OR_EQ(2) - EVT_CASE_OR_EQ(3) - EVT_EXEC_WAIT(N(koopa_standUp)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; +#include "../area.h" +#include "battle/common/actor/dark_paratroopa.inc.c" diff --git a/src/battle/area/tik/actor/gloomba.c b/src/battle/area/tik/actor/gloomba.c index 2c074530e6..5649be55e4 100644 --- a/src/battle/area/tik/actor/gloomba.c +++ b/src/battle/area/tik/actor/gloomba.c @@ -1,460 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Goomba.h" +#include "../area.h" -#define NAMESPACE b_area_tik_gloomba - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -extern s32 N(IdleAnimations)[]; - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 100, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 80, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 100, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 80, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 20 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_GLOOMBA, - .level = 11, - .maxHP = 7, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 70, - .airLiftChance = 90, - .hurricaneChance = 85, - .spookChance = 80, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 24, 24 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Dark_Idle, - STATUS_KEY_STONE, ANIM_Goomba_Dark_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Dark_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Dark_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Dark_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Dark_Idle, - STATUS_KEY_PARALYZE, ANIM_Goomba_Dark_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Dark_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Dark_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_step)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Dark_Run, - STATUS_KEY_STONE, ANIM_Goomba_Dark_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Dark_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Dark_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Dark_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Dark_Run, - STATUS_KEY_PARALYZE, ANIM_Goomba_Dark_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Dark_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Dark_Dizzy, - STATUS_END, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_LOOP(80) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Dizzy) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Run) - EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/CalculateArcsinDeg.inc.c" - -EvtScript N(takeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 10) - EVT_ADD(LVar2, 3) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Sleep) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Hurt) - EVT_WAIT(HIT_RESULT_LUCKY) - EVT_IF_EQ(LVarA, 5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_THREAD - EVT_WAIT(4) - EVT_SET(LVar0, 180) - EVT_LOOP(4) - EVT_SUB(LVar0, 45) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Dizzy) - EVT_WAIT(5) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Tense) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_END_SWITCH - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_WAIT(3) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/gloomba.inc.c" diff --git a/src/battle/area/tik/actor/paragloomba.c b/src/battle/area/tik/actor/paragloomba.c index ff3639fd14..e18f2378e9 100644 --- a/src/battle/area/tik/actor/paragloomba.c +++ b/src/battle/area/tik/actor/paragloomba.c @@ -1,934 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/Paragoomba.h" -#include "sprite/npc/Goomba.h" -#include "effects.h" +#include "../area.h" -#define NAMESPACE b_area_tik_paragloomba - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); -extern EvtScript N(fall); -extern EvtScript N(init_gloomba); -extern EvtScript N(takeTurn_gloomba); -extern EvtScript N(idle_gloomba); -extern EvtScript N(handleEvent_gloomba); - -extern s32 N(IdleAnimations_gloomba)[]; -extern s32 N(IdleAnimations)[]; -extern s32 N(IdleAnimations_left_wing)[]; -extern s32 N(IdleAnimations_right_wing)[]; - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(defenseTable2)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable_gloomba)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 100, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 80, - STATUS_KEY_FEAR, 100, - STATUS_KEY_STATIC, 100, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 80, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 80, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 90, - STATUS_KEY_FEAR, 80, - STATUS_KEY_STATIC, 80, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 80, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 20 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_gloomba), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(defenseTable2), - .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_3, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -16, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_left_wing), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_4, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -16, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations_right_wing), - .defenseTable = N(DefenseTable), - .eventFlags = 0, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -10 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_FLYING, - .type = ACTOR_TYPE_PARAGLOOMBA, - .level = 11, - .maxHP = 7, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 65, - .airLiftChance = 95, - .hurricaneChance = 90, - .spookChance = 80, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 36, 26 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Dark_Idle, - STATUS_KEY_STONE, ANIM_Paragoomba_Dark_Still, - STATUS_KEY_SLEEP, ANIM_Paragoomba_Dark_Sleep, - STATUS_KEY_POISON, ANIM_Paragoomba_Dark_Idle, - STATUS_KEY_STOP, ANIM_Paragoomba_Dark_Still, - STATUS_KEY_STATIC, ANIM_Paragoomba_Dark_Idle, - STATUS_KEY_PARALYZE, ANIM_Paragoomba_Dark_Still, - STATUS_KEY_DIZZY, ANIM_Paragoomba_Dark_Dizzy, - STATUS_KEY_FEAR, ANIM_Paragoomba_Dark_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_step)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Dark_Run, - STATUS_KEY_STONE, ANIM_Paragoomba_Dark_Still, - STATUS_KEY_SLEEP, ANIM_Paragoomba_Dark_Sleep, - STATUS_KEY_POISON, ANIM_Paragoomba_Dark_Idle, - STATUS_KEY_STOP, ANIM_Paragoomba_Dark_Still, - STATUS_KEY_STATIC, ANIM_Paragoomba_Dark_Run, - STATUS_KEY_PARALYZE, ANIM_Paragoomba_Dark_Still, - STATUS_KEY_DIZZY, ANIM_Paragoomba_Dark_Dizzy, - STATUS_KEY_FEAR, ANIM_Paragoomba_Dark_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_left_wing)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Dark_LWingStill, - STATUS_END, -}; - -s32 N(IdleAnimations_right_wing)[] = { - STATUS_KEY_NORMAL, ANIM_Paragoomba_Dark_RWingStill, - STATUS_END, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_step))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations))) - EVT_LOOP(40) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(returnHome) = { - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Idle) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(GetEncounterState, LVar0) - EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) - EVT_EXEC_WAIT(N(fall)) - EVT_END_IF - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_FALL_TRIGGER) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_EXEC_WAIT(N(fall)) - EVT_CASE_EQ(EVENT_15) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(fall)) - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dizzy) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) - EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) - EVT_CALL(HPBarToCurrent, ACTOR_SELF) - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Run) - EVT_SET_CONST(LVar2, ANIM_Paragoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 2) - EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(takeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_LINEAR) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 2, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) - EVT_CALL(SetBattleCamZoom, 300) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dive) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_SUB(LVar0, 80) - EVT_SET(LVar1, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dive) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) - EVT_THREAD - EVT_LOOP(4) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DF) - EVT_WAIT(4) - EVT_END_LOOP - EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Miss) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(3.0)) - EVT_WAIT(10) - EVT_IF_EQ(LVarA, 5) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(returnHome)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_WAIT(10) - EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) - EVT_CALL(SetBattleCamZoom, 300) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dive) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dive) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) - EVT_END_SWITCH - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) - EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) - EVT_EXEC_WAIT(N(returnHome)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/StartRumbleWithParams.inc.c" - -EvtScript N(fall) = { - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_3, -9, 7, -2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_4, 11, 7, -2) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_IF_EQ(LVar0, EVENT_15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_BurnStill) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Hurt) - EVT_END_IF - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(N(StartRumbleWithParams), 100, 10) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) - EVT_END_THREAD - EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar3) - EVT_IF_EQ(LVar3, 15) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Hurt) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) - EVT_ADD(LVar4, 10) - EVT_ADD(LVar5, 5) - EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar3, LVar4, LVar5, EVT_FLOAT(1.0), 10, 0) - EVT_END_IF - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_LOOP(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) - EVT_MOD(LVar0, 4) - EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_gloomba))) - EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_GLOOMBA) - EVT_EXEC_WAIT(N(init_gloomba)) - EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_RETURN - EVT_END -}; - -s32 N(IdleAnimations_gloomba)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Dark_Idle, - STATUS_KEY_STONE, ANIM_Goomba_Dark_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Dark_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Dark_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Dark_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Dark_Idle, - STATUS_KEY_PARALYZE, ANIM_Goomba_Dark_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Dark_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Dark_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_gloomba_step)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Dark_Run, - STATUS_KEY_STONE, ANIM_Goomba_Dark_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Dark_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Dark_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Dark_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Dark_Run, - STATUS_KEY_PARALYZE, ANIM_Goomba_Dark_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Dark_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Dark_Dizzy, - STATUS_END, -}; - -EvtScript N(init_gloomba) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_gloomba))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_gloomba))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_gloomba))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_gloomba) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_gloomba_step))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_gloomba))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_gloomba_step))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_gloomba))) - EVT_LOOP(80) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_gloomba) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Dizzy) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Run) - EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/CalculateArcsinDeg.inc.c" - -EvtScript N(takeTurn_gloomba) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 10) - EVT_ADD(LVar2, 3) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Sleep) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Hurt) - EVT_WAIT(5) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_THREAD - EVT_WAIT(4) - EVT_SET(LVar0, 180) - EVT_LOOP(4) - EVT_SUB(LVar0, 45) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Dizzy) - EVT_WAIT(5) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Tense) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_END_SWITCH - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) - EVT_WAIT(3) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/paragloomba.inc.c" diff --git a/src/battle/area/tik/actor/spike_top.c b/src/battle/area/tik/actor/spike_top.c index b43320de97..42d2c32d85 100644 --- a/src/battle/area/tik/actor/spike_top.c +++ b/src/battle/area/tik/actor/spike_top.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_tik_spike_top +#include "../area.h" #include "battle/common/actor/spike_top.inc.c" diff --git a/src/battle/area/tik/actor/spiked_gloomba.c b/src/battle/area/tik/actor/spiked_gloomba.c index 16112c8fb1..b472c12029 100644 --- a/src/battle/area/tik/actor/spiked_gloomba.c +++ b/src/battle/area/tik/actor/spiked_gloomba.c @@ -1,482 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" -#include "sprite/npc/SpikedGoomba.h" -#include "effects.h" +#include "../area.h" -#define NAMESPACE b_area_tik_spiked_gloomba - -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -extern s32 N(IdleAnimations)[]; - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 70, - STATUS_KEY_POISON, 80, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 80, - STATUS_KEY_FEAR, 80, - STATUS_KEY_STATIC, 80, - STATUS_KEY_PARALYZE, 90, - STATUS_KEY_SHRINK, 80, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -12 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_SPIKED_GLOOMBA, - .level = 12, - .maxHP = 7, - .partCount = ARRAY_COUNT(N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(init), - .statusTable = N(StatusTable), - .escapeChance = 65, - .airLiftChance = 90, - .hurricaneChance = 85, - .spookChance = 75, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 24, 28 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_SpikedGoomba_Dark_Idle, - STATUS_KEY_STONE, ANIM_SpikedGoomba_Dark_Still, - STATUS_KEY_SLEEP, ANIM_SpikedGoomba_Dark_Sleep, - STATUS_KEY_POISON, ANIM_SpikedGoomba_Dark_Idle, - STATUS_KEY_STOP, ANIM_SpikedGoomba_Dark_Still, - STATUS_KEY_STATIC, ANIM_SpikedGoomba_Dark_Idle, - STATUS_KEY_PARALYZE, ANIM_SpikedGoomba_Dark_Still, - STATUS_KEY_DIZZY, ANIM_SpikedGoomba_Dark_Dizzy, - STATUS_KEY_FEAR, ANIM_SpikedGoomba_Dark_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_step)[] = { - STATUS_KEY_NORMAL, ANIM_SpikedGoomba_Dark_Run, - STATUS_KEY_STONE, ANIM_SpikedGoomba_Dark_Still, - STATUS_KEY_SLEEP, ANIM_SpikedGoomba_Dark_Sleep, - STATUS_KEY_POISON, ANIM_SpikedGoomba_Dark_Idle, - STATUS_KEY_STOP, ANIM_SpikedGoomba_Dark_Still, - STATUS_KEY_STATIC, ANIM_SpikedGoomba_Dark_Run, - STATUS_KEY_PARALYZE, ANIM_SpikedGoomba_Dark_Still, - STATUS_KEY_DIZZY, ANIM_SpikedGoomba_Dark_Dizzy, - STATUS_KEY_FEAR, ANIM_SpikedGoomba_Dark_Dizzy, - STATUS_END, -}; - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_LOOP(80) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_BurnEyesClosed) - EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_Dark_BurnEyesOpen) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_BurnEyesClosed) - EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_Dark_BurnEyesOpen) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_BurnEyesOpen) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Dizzy) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_HurtStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Run) - EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIKE_TAUNT) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Laugh) - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) - EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_ADD(LVar1, 10) - EVT_ELSE - EVT_ADD(LVar1, 26) - EVT_END_IF - EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) - EVT_WAIT(20) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/CalculateArcsinDeg.inc.c" - -EvtScript N(takeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 10) - EVT_ADD(LVar2, 3) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Sleep) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Hurt) - EVT_WAIT(5) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_THREAD - EVT_WAIT(4) - EVT_SET(LVar0, 180) - EVT_LOOP(4) - EVT_SUB(LVar0, 45) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Dizzy) - EVT_WAIT(5) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_END_SWITCH - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) - EVT_IF_GT(LVar0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Laugh) - EVT_WAIT(15) - EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) - EVT_WAIT(3) - EVT_END_IF - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/spiked_gloomba.inc.c" diff --git a/src/battle/area/tik/actor/spiny.c b/src/battle/area/tik/actor/spiny.c index af2a8bb3ca..660440d73b 100644 --- a/src/battle/area/tik/actor/spiny.c +++ b/src/battle/area/tik/actor/spiny.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_tik_spiny +#include "../area.h" #include "battle/common/actor/spiny.inc.c" diff --git a/src/battle/area/tik/area.c b/src/battle/area/tik/area.c index 28c026a210..906a7a8c78 100644 --- a/src/battle/area/tik/area.c +++ b/src/battle/area/tik/area.c @@ -1,207 +1,204 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_tik +extern ActorBlueprint A(dark_koopa); +extern ActorBlueprint A(dark_paratroopa); +extern ActorBlueprint A(gloomba); +extern ActorBlueprint A(spiked_gloomba); +extern ActorBlueprint A(paragloomba); +extern ActorBlueprint A(buzzy_beetle); +extern ActorBlueprint A(spike_top); +extern ActorBlueprint A(spiny); -extern ActorBlueprint N(dark_koopa); -extern ActorBlueprint N(dark_paratroopa); -extern ActorBlueprint N(gloomba); -extern ActorBlueprint N(spiked_gloomba); -extern ActorBlueprint N(paragloomba); -extern ActorBlueprint N(buzzy_beetle); -extern ActorBlueprint N(spike_top); -extern ActorBlueprint N(spiny); +extern Stage A(tik_01); +extern Stage A(tik_02); +extern Stage A(tik_03); +extern Stage A(tik_04); +extern Stage A(tik_05); -extern Stage N(tik_01); -extern Stage N(tik_02); -extern Stage N(tik_03); -extern Stage N(tik_04); -extern Stage N(tik_05); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_D, 7), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(dark_paratroopa), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(dark_paratroopa), BTL_POS_AIR_C, 8), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(dark_paratroopa), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(dark_paratroopa), BTL_POS_AIR_C, 8), }; -Formation N(Formation_04) = { - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_C, 8), +Formation A(Formation_04) = { + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_05) = { - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_C, 8), +Formation A(Formation_05) = { + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_06) = { - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_C, 8), +Formation A(Formation_06) = { + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_07) = { - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(dark_koopa), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_D, 7), +Formation A(Formation_07) = { + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(dark_koopa), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_08) = { - ACTOR_BY_IDX(N(dark_paratroopa), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(dark_paratroopa), BTL_POS_AIR_C, 9), +Formation A(Formation_08) = { + ACTOR_BY_IDX(A(dark_paratroopa), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(dark_paratroopa), BTL_POS_AIR_C, 9), }; -Formation N(Formation_09) = { - ACTOR_BY_IDX(N(dark_paratroopa), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(dark_paratroopa), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(dark_paratroopa), BTL_POS_AIR_C, 8), +Formation A(Formation_09) = { + ACTOR_BY_IDX(A(dark_paratroopa), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(dark_paratroopa), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(dark_paratroopa), BTL_POS_AIR_C, 8), }; -Formation N(Formation_0A) = { - ACTOR_BY_IDX(N(gloomba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(gloomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_0A) = { + ACTOR_BY_IDX(A(gloomba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(gloomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0B) = { - ACTOR_BY_IDX(N(gloomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(gloomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(gloomba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(gloomba), BTL_POS_GROUND_D, 7), +Formation A(Formation_0B) = { + ACTOR_BY_IDX(A(gloomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(gloomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(gloomba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(gloomba), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_0C) = { - ACTOR_BY_IDX(N(paragloomba), BTL_POS_AIR_A, 10), - ACTOR_BY_IDX(N(paragloomba), BTL_POS_AIR_B, 9), - ACTOR_BY_IDX(N(paragloomba), BTL_POS_AIR_C, 8), +Formation A(Formation_0C) = { + ACTOR_BY_IDX(A(paragloomba), BTL_POS_AIR_A, 10), + ACTOR_BY_IDX(A(paragloomba), BTL_POS_AIR_B, 9), + ACTOR_BY_IDX(A(paragloomba), BTL_POS_AIR_C, 8), }; -Formation N(Formation_0D) = { - ACTOR_BY_IDX(N(paragloomba), BTL_POS_AIR_B, 10), - ACTOR_BY_IDX(N(spiked_gloomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_0D) = { + ACTOR_BY_IDX(A(paragloomba), BTL_POS_AIR_B, 10), + ACTOR_BY_IDX(A(spiked_gloomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0E) = { - ACTOR_BY_IDX(N(spiked_gloomba), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(spiked_gloomba), BTL_POS_GROUND_C, 9), +Formation A(Formation_0E) = { + ACTOR_BY_IDX(A(spiked_gloomba), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(spiked_gloomba), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_0F) = { - ACTOR_BY_IDX(N(spiked_gloomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(gloomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(gloomba), BTL_POS_GROUND_C, 8), +Formation A(Formation_0F) = { + ACTOR_BY_IDX(A(spiked_gloomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(gloomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(gloomba), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_10) = { - ACTOR_BY_IDX(N(spiked_gloomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_C, 8), +Formation A(Formation_10) = { + ACTOR_BY_IDX(A(spiked_gloomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_11) = { - ACTOR_BY_IDX(N(spiked_gloomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiked_gloomba), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_D, 7), +Formation A(Formation_11) = { + ACTOR_BY_IDX(A(spiked_gloomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiked_gloomba), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_12) = { - ACTOR_BY_IDX(N(spiked_gloomba), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(paragloomba), BTL_POS_AIR_C, 8), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_D, 7), +Formation A(Formation_12) = { + ACTOR_BY_IDX(A(spiked_gloomba), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(paragloomba), BTL_POS_AIR_C, 8), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_13) = { - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_D, 7), +Formation A(Formation_13) = { + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_D, 7), }; -Formation N(Formation_14) = { - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(spike_top), BTL_POS_GROUND_C, 9), +Formation A(Formation_14) = { + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(spike_top), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_15) = { - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiked_gloomba), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(buzzy_beetle), BTL_POS_GROUND_C, 8), +Formation A(Formation_15) = { + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiked_gloomba), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(buzzy_beetle), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_16) = { - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_B, 10), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_C, 9), +Formation A(Formation_16) = { + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_B, 10), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_C, 9), }; -Formation N(Formation_17) = { - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_C, 8), +Formation A(Formation_17) = { + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_C, 8), }; -Formation N(Formation_18) = { - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_A, 10), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_B, 9), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_C, 8), - ACTOR_BY_IDX(N(spiny), BTL_POS_GROUND_D, 7), +Formation A(Formation_18) = { + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_A, 10), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_B, 9), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_C, 8), + ACTOR_BY_IDX(A(spiny), BTL_POS_GROUND_D, 7), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(tik_01), "ヤミノコノコx2"), - BATTLE(N(Formation_01), N(tik_01), "ヤミノコノコx3"), - BATTLE(N(Formation_02), N(tik_01), "ヤミノコノコx4"), - BATTLE(N(Formation_03), N(tik_01), "ヤミノコノコ,ヤミパタパタx2"), - BATTLE(N(Formation_04), N(tik_01), "ヤミノコノコ,トゲメットx2"), - BATTLE(N(Formation_05), N(tik_01), "ヤミノコノコ,トゲメット,ヤミノコノコ"), - BATTLE(N(Formation_06), N(tik_01), "ヤミノコノコ,トゲゾーx2"), - BATTLE(N(Formation_07), N(tik_01), "ヤミノコノコ,トゲゾー,ヤミノコノコ,トゲゾー"), - BATTLE(N(Formation_08), N(tik_01), "ヤミパタパタx2"), - BATTLE(N(Formation_09), N(tik_01), "ヤミパタパタx3"), - BATTLE(N(Formation_0A), N(tik_01), "ヤミクリボーx2"), - BATTLE(N(Formation_0B), N(tik_01), "ヤミクリボーx4"), - BATTLE(N(Formation_0C), N(tik_01), "ヤミパタクリx3"), - BATTLE(N(Formation_0D), N(tik_01), "ヤミパタクリ,ヤミトゲクリ"), - BATTLE(N(Formation_0E), N(tik_01), "ヤミトゲクリx2"), - BATTLE(N(Formation_0F), N(tik_01), "ヤミトゲクリ,ヤミクリボーx2"), - BATTLE(N(Formation_10), N(tik_01), "ヤミトゲクリ,メットx2"), - BATTLE(N(Formation_11), N(tik_01), "ヤミトゲクリ,メット,ヤミトゲクリ,メット"), - BATTLE(N(Formation_12), N(tik_01), "ヤミトゲクリ,メット,ヤミパタクリ,メット"), - BATTLE(N(Formation_13), N(tik_01), "トゲメットx4"), - BATTLE(N(Formation_14), N(tik_01), "トゲメットx2"), - BATTLE(N(Formation_15), N(tik_01), "メット,ヤミトゲクリ,メット"), - BATTLE(N(Formation_16), N(tik_01), "トゲゾーx2"), - BATTLE(N(Formation_17), N(tik_01), "トゲゾーx3"), - BATTLE(N(Formation_18), N(tik_01), "トゲゾーx4"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(tik_01), "ヤミノコノコx2"), + BATTLE(A(Formation_01), A(tik_01), "ヤミノコノコx3"), + BATTLE(A(Formation_02), A(tik_01), "ヤミノコノコx4"), + BATTLE(A(Formation_03), A(tik_01), "ヤミノコノコ,ヤミパタパタx2"), + BATTLE(A(Formation_04), A(tik_01), "ヤミノコノコ,トゲメットx2"), + BATTLE(A(Formation_05), A(tik_01), "ヤミノコノコ,トゲメット,ヤミノコノコ"), + BATTLE(A(Formation_06), A(tik_01), "ヤミノコノコ,トゲゾーx2"), + BATTLE(A(Formation_07), A(tik_01), "ヤミノコノコ,トゲゾー,ヤミノコノコ,トゲゾー"), + BATTLE(A(Formation_08), A(tik_01), "ヤミパタパタx2"), + BATTLE(A(Formation_09), A(tik_01), "ヤミパタパタx3"), + BATTLE(A(Formation_0A), A(tik_01), "ヤミクリボーx2"), + BATTLE(A(Formation_0B), A(tik_01), "ヤミクリボーx4"), + BATTLE(A(Formation_0C), A(tik_01), "ヤミパタクリx3"), + BATTLE(A(Formation_0D), A(tik_01), "ヤミパタクリ,ヤミトゲクリ"), + BATTLE(A(Formation_0E), A(tik_01), "ヤミトゲクリx2"), + BATTLE(A(Formation_0F), A(tik_01), "ヤミトゲクリ,ヤミクリボーx2"), + BATTLE(A(Formation_10), A(tik_01), "ヤミトゲクリ,メットx2"), + BATTLE(A(Formation_11), A(tik_01), "ヤミトゲクリ,メット,ヤミトゲクリ,メット"), + BATTLE(A(Formation_12), A(tik_01), "ヤミトゲクリ,メット,ヤミパタクリ,メット"), + BATTLE(A(Formation_13), A(tik_01), "トゲメットx4"), + BATTLE(A(Formation_14), A(tik_01), "トゲメットx2"), + BATTLE(A(Formation_15), A(tik_01), "メット,ヤミトゲクリ,メット"), + BATTLE(A(Formation_16), A(tik_01), "トゲゾーx2"), + BATTLE(A(Formation_17), A(tik_01), "トゲゾーx3"), + BATTLE(A(Formation_18), A(tik_01), "トゲゾーx4"), {}, }; -StageList N(Stages) = { - STAGE("tik_01", N(tik_01)), - STAGE("tik_02", N(tik_02)), - STAGE("tik_03", N(tik_03)), - STAGE("tik_04", N(tik_04)), - STAGE("tik_05", N(tik_05)), +StageList A(Stages) = { + STAGE("tik_01", A(tik_01)), + STAGE("tik_02", A(tik_02)), + STAGE("tik_03", A(tik_03)), + STAGE("tik_04", A(tik_04)), + STAGE("tik_05", A(tik_05)), {}, }; diff --git a/src/battle/area/tik/area.h b/src/battle/area/tik/area.h new file mode 100644 index 0000000000..ac53caa189 --- /dev/null +++ b/src/battle/area/tik/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_tik diff --git a/src/battle/area/tik/stage/tik_01.c b/src/battle/area/tik/stage/tik_01.c index 80dcbde5f5..5104f8df7d 100644 --- a/src/battle/area/tik/stage/tik_01.c +++ b/src/battle/area/tik/stage/tik_01.c @@ -1,227 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_tik_tik_01 - -#include "world/common/todo/UnkFunc56.inc.c" - -EvtScript N(802301F0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802302C0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802303AC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80230498) = { - EVT_SET(LVar1, ArrayVar(5)) - EVT_ADD(LVar1, 1) - EVT_SET(LVar2, ArrayVar(0)) - EVT_SET(LVar3, ArrayVar(1)) - EVT_SET(LVar4, ArrayVar(5)) - EVT_ADD(LVar4, 2) - EVT_SET(LVar5, ArrayVar(0)) - EVT_SET(LVar6, ArrayVar(1)) - EVT_SET(LVar7, ArrayVar(5)) - EVT_ADD(LVar7, 3) - EVT_SET(LVar8, ArrayVar(0)) - EVT_SET(LVar9, ArrayVar(1)) - EVT_SET(LVarA, ArrayVar(5)) - EVT_ADD(LVarA, 4) - EVT_SET(LVarB, ArrayVar(0)) - EVT_SET(LVarC, ArrayVar(1)) - EVT_CALL(EnableModel, LVar1, TRUE) - EVT_CALL(EnableModel, LVar4, TRUE) - EVT_CALL(EnableModel, LVar7, TRUE) - EVT_CALL(EnableModel, LVarA, TRUE) - EVT_LOOP(5) - EVT_ADD(LVar0, 1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_LOOP(5) - EVT_ADD(LVar0, -1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(EnableModel, LVar1, FALSE) - EVT_CALL(EnableModel, LVar4, FALSE) - EVT_CALL(EnableModel, LVar7, FALSE) - EVT_CALL(EnableModel, LVarA, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80230968) = { - EVT_SET_GROUP(0) - EVT_USE_ARRAY(LVarA) - EVT_SET(LVar5, ArrayVar(5)) - EVT_LOOP(5) - EVT_CALL(CloneModel, 16, LVar5) - EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) - EVT_ADD(LVar5, 1) - EVT_END_LOOP - EVT_LABEL(0) - EVT_CALL(RandInt, 200, LVar0) - EVT_ADD(LVar0, 50) - EVT_WAIT(LVar0) - EVT_CALL(EnableModel, ArrayVar(5), TRUE) - EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) - EVT_WAIT(1) - EVT_CALL(N(UnkFunc56), ArrayVar(5)) - EVT_IF_EQ(LVar2, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_LABEL(10) - EVT_CALL(EnableModel, ArrayVar(5), FALSE) - EVT_EXEC_WAIT(N(80230498)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80230B30) = { - EVT_SET(LVarF, 10000) - EVT_USE_BUF(LVar0) - EVT_BUF_READ1(LVar1) - EVT_LOOP(LVar1) - EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) - EVT_BUF_READ3(LVar6, LVar7, LVar8) - EVT_BUF_READ1(LVar9) - EVT_LOOP(LVar9) - EVT_MALLOC_ARRAY(6, LVarA) - EVT_USE_ARRAY(LVarA) - EVT_CALL(RandInt, LVar4, LVarB) - EVT_CALL(RandInt, LVar5, LVarC) - EVT_SET(LVarD, LVar2) - EVT_SET(LVarE, LVar3) - EVT_ADD(LVarD, LVarB) - EVT_ADD(LVarE, LVarC) - EVT_SET(ArrayVar(0), LVarD) - EVT_SET(ArrayVar(1), LVarE) - EVT_SET(ArrayVar(2), LVar6) - EVT_SET(ArrayVar(3), LVar7) - EVT_SET(ArrayVar(4), LVar8) - EVT_SET(ArrayVar(5), LVarF) - EVT_CHILD_THREAD - EVT_EXEC(N(80230968)) - EVT_END_CHILD_THREAD - EVT_ADD(LVarF, 5) - EVT_END_LOOP - EVT_END_LOOP - EVT_CALL(EnableModel, 16, FALSE) - EVT_RETURN - EVT_END -}; - -s32 N(80230CEC)[] = { - 1, -100, -50, 200, 100, 200, 0, 60, 4, -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, -500) - EVT_EXEC(N(802301F0)) - EVT_SET(LVar0, N(80230CEC)) - EVT_EXEC(N(80230B30)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt01_shape", - .hit = "tik_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_tik/tik_01.inc.c" diff --git a/src/battle/area/tik/stage/tik_02.c b/src/battle/area/tik/stage/tik_02.c index 542550db56..dce698c893 100644 --- a/src/battle/area/tik/stage/tik_02.c +++ b/src/battle/area/tik/stage/tik_02.c @@ -1,227 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_tik_tik_02 - -#include "world/common/todo/UnkFunc56.inc.c" - -EvtScript N(80230DF0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80230EC0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80230FAC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80231098) = { - EVT_SET(LVar1, ArrayVar(5)) - EVT_ADD(LVar1, 1) - EVT_SET(LVar2, ArrayVar(0)) - EVT_SET(LVar3, ArrayVar(1)) - EVT_SET(LVar4, ArrayVar(5)) - EVT_ADD(LVar4, 2) - EVT_SET(LVar5, ArrayVar(0)) - EVT_SET(LVar6, ArrayVar(1)) - EVT_SET(LVar7, ArrayVar(5)) - EVT_ADD(LVar7, 3) - EVT_SET(LVar8, ArrayVar(0)) - EVT_SET(LVar9, ArrayVar(1)) - EVT_SET(LVarA, ArrayVar(5)) - EVT_ADD(LVarA, 4) - EVT_SET(LVarB, ArrayVar(0)) - EVT_SET(LVarC, ArrayVar(1)) - EVT_CALL(EnableModel, LVar1, TRUE) - EVT_CALL(EnableModel, LVar4, TRUE) - EVT_CALL(EnableModel, LVar7, TRUE) - EVT_CALL(EnableModel, LVarA, TRUE) - EVT_LOOP(5) - EVT_ADD(LVar0, 1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_LOOP(5) - EVT_ADD(LVar0, -1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(EnableModel, LVar1, FALSE) - EVT_CALL(EnableModel, LVar4, FALSE) - EVT_CALL(EnableModel, LVar7, FALSE) - EVT_CALL(EnableModel, LVarA, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80231568) = { - EVT_SET_GROUP(0) - EVT_USE_ARRAY(LVarA) - EVT_SET(LVar5, ArrayVar(5)) - EVT_LOOP(5) - EVT_CALL(CloneModel, 16, LVar5) - EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) - EVT_ADD(LVar5, 1) - EVT_END_LOOP - EVT_LABEL(0) - EVT_CALL(RandInt, 200, LVar0) - EVT_ADD(LVar0, 50) - EVT_WAIT(LVar0) - EVT_CALL(EnableModel, ArrayVar(5), TRUE) - EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) - EVT_WAIT(1) - EVT_CALL(N(UnkFunc56), ArrayVar(5)) - EVT_IF_EQ(LVar2, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_LABEL(10) - EVT_CALL(EnableModel, ArrayVar(5), FALSE) - EVT_EXEC_WAIT(N(80231098)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80231730) = { - EVT_SET(LVarF, 10000) - EVT_USE_BUF(LVar0) - EVT_BUF_READ1(LVar1) - EVT_LOOP(LVar1) - EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) - EVT_BUF_READ3(LVar6, LVar7, LVar8) - EVT_BUF_READ1(LVar9) - EVT_LOOP(LVar9) - EVT_MALLOC_ARRAY(6, LVarA) - EVT_USE_ARRAY(LVarA) - EVT_CALL(RandInt, LVar4, LVarB) - EVT_CALL(RandInt, LVar5, LVarC) - EVT_SET(LVarD, LVar2) - EVT_SET(LVarE, LVar3) - EVT_ADD(LVarD, LVarB) - EVT_ADD(LVarE, LVarC) - EVT_SET(ArrayVar(0), LVarD) - EVT_SET(ArrayVar(1), LVarE) - EVT_SET(ArrayVar(2), LVar6) - EVT_SET(ArrayVar(3), LVar7) - EVT_SET(ArrayVar(4), LVar8) - EVT_SET(ArrayVar(5), LVarF) - EVT_CHILD_THREAD - EVT_EXEC(N(80231568)) - EVT_END_CHILD_THREAD - EVT_ADD(LVarF, 5) - EVT_END_LOOP - EVT_END_LOOP - EVT_CALL(EnableModel, 16, FALSE) - EVT_RETURN - EVT_END -}; - -s32 N(802318EC)[] = { - 1, -100, -50, 200, 100, 200, 0, 60, 4, -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, N(802318EC)) - EVT_EXEC(N(80231730)) - EVT_SET(LVar0, 14) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, -500) - EVT_EXEC(N(80230DF0)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt02_shape", - .hit = "tik_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_tik/tik_02.inc.c" diff --git a/src/battle/area/tik/stage/tik_03.c b/src/battle/area/tik/stage/tik_03.c index c623cd98dc..6a6ff7fe81 100644 --- a/src/battle/area/tik/stage/tik_03.c +++ b/src/battle/area/tik/stage/tik_03.c @@ -1,170 +1,3 @@ -#include "common.h" -#include "battle/battle.h" - -#define NAMESPACE b_area_tik_tik_03 - -#include "world/common/todo/UnkFunc56.inc.c" - -EvtScript N(802319F0) = { - EVT_SET(LVar1, ArrayVar(5)) - EVT_ADD(LVar1, 1) - EVT_SET(LVar2, ArrayVar(0)) - EVT_SET(LVar3, ArrayVar(1)) - EVT_SET(LVar4, ArrayVar(5)) - EVT_ADD(LVar4, 2) - EVT_SET(LVar5, ArrayVar(0)) - EVT_SET(LVar6, ArrayVar(1)) - EVT_SET(LVar7, ArrayVar(5)) - EVT_ADD(LVar7, 3) - EVT_SET(LVar8, ArrayVar(0)) - EVT_SET(LVar9, ArrayVar(1)) - EVT_SET(LVarA, ArrayVar(5)) - EVT_ADD(LVarA, 4) - EVT_SET(LVarB, ArrayVar(0)) - EVT_SET(LVarC, ArrayVar(1)) - EVT_CALL(EnableModel, LVar1, TRUE) - EVT_CALL(EnableModel, LVar4, TRUE) - EVT_CALL(EnableModel, LVar7, TRUE) - EVT_CALL(EnableModel, LVarA, TRUE) - EVT_LOOP(5) - EVT_ADD(LVar0, 1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_LOOP(5) - EVT_ADD(LVar0, -1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(EnableModel, LVar1, FALSE) - EVT_CALL(EnableModel, LVar4, FALSE) - EVT_CALL(EnableModel, LVar7, FALSE) - EVT_CALL(EnableModel, LVarA, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80231EC0) = { - EVT_SET_GROUP(0) - EVT_USE_ARRAY(LVarA) - EVT_SET(LVar5, ArrayVar(5)) - EVT_LOOP(5) - EVT_CALL(CloneModel, 18, LVar5) - EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) - EVT_ADD(LVar5, 1) - EVT_END_LOOP - EVT_LABEL(0) - EVT_CALL(RandInt, 200, LVar0) - EVT_ADD(LVar0, 50) - EVT_WAIT(LVar0) - EVT_CALL(EnableModel, ArrayVar(5), TRUE) - EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) - EVT_WAIT(1) - EVT_CALL(N(UnkFunc56), ArrayVar(5)) - EVT_IF_EQ(LVar2, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_LABEL(10) - EVT_CALL(EnableModel, ArrayVar(5), FALSE) - EVT_EXEC_WAIT(N(802319F0)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80232088) = { - EVT_SET(LVarF, 10000) - EVT_USE_BUF(LVar0) - EVT_BUF_READ1(LVar1) - EVT_LOOP(LVar1) - EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) - EVT_BUF_READ3(LVar6, LVar7, LVar8) - EVT_BUF_READ1(LVar9) - EVT_LOOP(LVar9) - EVT_MALLOC_ARRAY(6, LVarA) - EVT_USE_ARRAY(LVarA) - EVT_CALL(RandInt, LVar4, LVarB) - EVT_CALL(RandInt, LVar5, LVarC) - EVT_SET(LVarD, LVar2) - EVT_SET(LVarE, LVar3) - EVT_ADD(LVarD, LVarB) - EVT_ADD(LVarE, LVarC) - EVT_SET(ArrayVar(0), LVarD) - EVT_SET(ArrayVar(1), LVarE) - EVT_SET(ArrayVar(2), LVar6) - EVT_SET(ArrayVar(3), LVar7) - EVT_SET(ArrayVar(4), LVar8) - EVT_SET(ArrayVar(5), LVarF) - EVT_CHILD_THREAD - EVT_EXEC(N(80231EC0)) - EVT_END_CHILD_THREAD - EVT_ADD(LVarF, 5) - EVT_END_LOOP - EVT_END_LOOP - EVT_CALL(EnableModel, 18, FALSE) - EVT_RETURN - EVT_END -}; - -s32 N(80232244)[] = { - 1, -100, -50, 200, 100, 200, 0, 60, 4, -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, N(80232244)) - EVT_EXEC(N(80232088)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt03_shape", - .hit = "tik_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "../area.h" +#include "battle/common/stage/area_tik/tik_03.inc.c" diff --git a/src/battle/area/tik/stage/tik_04.c b/src/battle/area/tik/stage/tik_04.c index f7b7f70f76..b9b71e497d 100644 --- a/src/battle/area/tik/stage/tik_04.c +++ b/src/battle/area/tik/stage/tik_04.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" - -#define NAMESPACE b_area_tik_tik_04 - -#include "battle/common/stage/lib/WaterEffects.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SET(LVar0, 15) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, 16) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, 17) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(5) - EVT_SET(LVar0, 9) - EVT_SET(LVar1, 145) - EVT_EXEC(N(script3)) - EVT_SET(LVar0, 10) - EVT_SET(LVar1, 145) - EVT_EXEC(N(script3)) - EVT_END_THREAD - EVT_SET(LVar0, 12) - EVT_SET(LVar1, 60) - EVT_EXEC(N(script3)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 60) - EVT_EXEC(N(script3)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt04_shape", - .hit = "tik_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; - +#include "../area.h" +#include "battle/common/stage/area_tik/tik_04.inc.c" diff --git a/src/battle/area/tik/stage/tik_05.c b/src/battle/area/tik/stage/tik_05.c index e3eebe860d..ccb38f578d 100644 --- a/src/battle/area/tik/stage/tik_05.c +++ b/src/battle/area/tik/stage/tik_05.c @@ -1,52 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/tik_bt05_shape.h" - -#define NAMESPACE b_area_tik_tik_05 - -#include "world/common/atomic/TexturePan.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetTexPanner, MODEL_taki1, TEX_PANNER_1) - EVT_CALL(EnableTexPanning, MODEL_taki1, TRUE) - EVT_THREAD - TEX_PAN_PARAMS_ID(TEX_PANNER_1) - TEX_PAN_PARAMS_STEP( 0, -2700, 0, -3000) - TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1) - TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) - EVT_EXEC(N(EVS_UpdateTexturePan)) - EVT_END_THREAD - EVT_CALL(SetTexPanner, MODEL_taki2, TEX_PANNER_2) - EVT_CALL(EnableTexPanning, MODEL_taki2, TRUE) - EVT_THREAD - TEX_PAN_PARAMS_ID(TEX_PANNER_2) - TEX_PAN_PARAMS_STEP( 50, -200, 110, -500) - TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1) - TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) - EVT_EXEC(N(EVS_UpdateTexturePan)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_taki1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt05_shape", - .hit = "tik_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "../area.h" +#include "battle/common/stage/area_tik/tik_05.inc.c" diff --git a/src/battle/area/tik2/actor/blooper.c b/src/battle/area/tik2/actor/blooper.c index 3c17d6e3dc..9e15216635 100644 --- a/src/battle/area/tik2/actor/blooper.c +++ b/src/battle/area/tik2/actor/blooper.c @@ -1,9 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/Blooper.h" -#define NAMESPACE b_area_tik2_blooper +#define NAMESPACE A(blooper) extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -289,12 +287,12 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) @@ -314,47 +312,47 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim00) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(FloatToHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_EXEC_WAIT(N(FloatToHome)) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim00) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT @@ -366,7 +364,7 @@ EvtScript N(handleEvent) = { }; EvtScript N(onDeath) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END diff --git a/src/battle/area/tik2/actor/blooper_baby.c b/src/battle/area/tik2/actor/blooper_baby.c index 737be05b62..8c95fe2ad5 100644 --- a/src/battle/area/tik2/actor/blooper_baby.c +++ b/src/battle/area/tik2/actor/blooper_baby.c @@ -1,11 +1,8 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/BabyBlooper.h" #include "battle/action_cmd/stop_leech.h" -#include "effects.h" -#define NAMESPACE b_area_tik2_blooper_baby +#define NAMESPACE A(blooper_baby) extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -313,12 +310,12 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim03) @@ -338,49 +335,49 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim03) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim00) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(FloatToHome)) EVT_CASE_OR_EQ(EVENT_SHOCK_DEATH) EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim03) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_EXEC_WAIT(N(FloatToHome)) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BabyBlooper_Anim00) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT @@ -392,7 +389,7 @@ EvtScript N(handleEvent) = { }; EvtScript N(onDeath) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END diff --git a/src/battle/area/tik2/actor/electro_blooper.c b/src/battle/area/tik2/actor/electro_blooper.c index c65f055f8d..ee947dd925 100644 --- a/src/battle/area/tik2/actor/electro_blooper.c +++ b/src/battle/area/tik2/actor/electro_blooper.c @@ -1,10 +1,7 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/Blooper.h" -#include "effects.h" -#define NAMESPACE b_area_tik2_electro_blooper +#define NAMESPACE A(electro_blooper) extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -391,13 +388,13 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(discharge)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(discharge)) @@ -420,16 +417,16 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(discharge)) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(discharge)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -438,40 +435,40 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) EVT_CASE_OR_EQ(EVENT_INVUNERABLE_TAUNT) EVT_CASE_OR_EQ(EVENT_1E) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim00) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_OR_EQ(EVENT_STAR_BEAM) EVT_CASE_OR_EQ(EVENT_PEACH_BEAM) EVT_EXEC_WAIT(N(discharge)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(FloatToHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_EXEC_WAIT(N(FloatToHome)) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim00) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT @@ -483,7 +480,7 @@ EvtScript N(handleEvent) = { }; EvtScript N(onDeath) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END diff --git a/src/battle/area/tik2/actor/super_blooper.c b/src/battle/area/tik2/actor/super_blooper.c index 5a656a3f25..f717d891fe 100644 --- a/src/battle/area/tik2/actor/super_blooper.c +++ b/src/battle/area/tik2/actor/super_blooper.c @@ -1,11 +1,9 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" +#include "../area.h" #include "sprite/npc/Blooper.h" -#define NAMESPACE b_area_tik2_super_blooper +#define NAMESPACE A(super_blooper) -extern ActorBlueprint b_area_tik2_blooper_baby; +extern ActorBlueprint A(blooper_baby); extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -346,15 +344,15 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -368,19 +366,19 @@ EvtScript N(handleEvent) = { EVT_SET(LVar1, ANIM_Blooper_Anim05) EVT_SET(LVar2, ANIM_Blooper_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim06) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN @@ -389,42 +387,42 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) EVT_CASE_OR_EQ(EVENT_INVUNERABLE_TAUNT) EVT_CASE_OR_EQ(EVENT_1E) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim00) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_OR_EQ(EVENT_STAR_BEAM) EVT_CASE_OR_EQ(EVENT_PEACH_BEAM) EVT_EXEC_WAIT(N(unEnrage)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_EXEC_WAIT(N(unEnrage)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(FloatToHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_EXEC_WAIT(N(unEnrage)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim04) EVT_EXEC_WAIT(N(onDeath)) EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) EVT_EXEC_WAIT(N(FloatToHome)) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Blooper_Anim00) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_DEFAULT @@ -719,12 +717,12 @@ EvtScript N(makeBabies) = { EVT_CALL(ActorExists, ACTOR_ENEMY1, LVar1) EVT_IF_EQ(LVar1, 0) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3D9) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_baby_1)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_baby_1)), FALSE) EVT_END_IF EVT_CALL(ActorExists, ACTOR_ENEMY2, LVar1) EVT_IF_EQ(LVar1, 0) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3D9) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_baby_2)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_baby_2)), FALSE) EVT_END_IF EVT_WAIT(2) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Blooper_Anim0C) @@ -894,12 +892,12 @@ EvtScript N(unEnrage) = { EVT_END }; -Vec3i N(baby_pos) = { 400, 0, 0 }; +Vec3i N(BabyPos) = { 400, 0, 0 }; Formation N(formation_baby_1) = { - ACTOR_BY_POS(b_area_tik2_blooper_baby, N(baby_pos), 95, 30, 68), + ACTOR_BY_POS(A(blooper_baby), N(BabyPos), 95, 30, 68), }; Formation N(formation_baby_2) = { - ACTOR_BY_POS(b_area_tik2_blooper_baby, N(baby_pos), 94, 134, 45), + ACTOR_BY_POS(A(blooper_baby), N(BabyPos), 94, 134, 45), }; diff --git a/src/battle/area/tik2/area.c b/src/battle/area/tik2/area.c index 6b0768d05f..0e35113779 100644 --- a/src/battle/area/tik2/area.c +++ b/src/battle/area/tik2/area.c @@ -1,46 +1,43 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_tik2 +extern ActorBlueprint A(blooper); +extern ActorBlueprint A(electro_blooper); +extern ActorBlueprint A(super_blooper); -extern ActorBlueprint N(blooper); -extern ActorBlueprint N(electro_blooper); -extern ActorBlueprint N(super_blooper); +extern Stage A(tik_01); +extern Stage A(tik_02); +extern Stage A(tik_03); +extern Stage A(tik_04); +extern Stage A(tik_05); -extern Stage N(tik_01); -extern Stage N(tik_02); -extern Stage N(tik_03); -extern Stage N(tik_04); -extern Stage N(tik_05); +Vec3i A(BlooperPos) = { 80, 45, -10 }; -Vec3i N(blooper_pos) = { 80, 45, -10 }; - -Formation N(Formation_00) = { - ACTOR_BY_POS(N(blooper), N(blooper_pos), 10), +Formation A(Formation_00) = { + ACTOR_BY_POS(A(blooper), A(BlooperPos), 10), }; -Formation N(Formation_01) = { - ACTOR_BY_POS(N(electro_blooper), N(blooper_pos), 10), +Formation A(Formation_01) = { + ACTOR_BY_POS(A(electro_blooper), A(BlooperPos), 10), }; -Formation N(Formation_02) = { - ACTOR_BY_POS(N(super_blooper), N(blooper_pos), 10), +Formation A(Formation_02) = { + ACTOR_BY_POS(A(super_blooper), A(BlooperPos), 10), }; // ソ is encoded as 0x83 0x5C, so it needs another backslash to be interpreted as valid escape sequence // TODO modify iconv instead of strings in this file -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(tik_01), "ゲッソ\ー"), - BATTLE(N(Formation_01), N(tik_01), "ビリビリゲッソ\ー"), - BATTLE(N(Formation_02), N(tik_01), "ビッグゲッソ\ー チビゲッソ\ー"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(tik_01), "ゲッソ\ー"), + BATTLE(A(Formation_01), A(tik_01), "ビリビリゲッソ\ー"), + BATTLE(A(Formation_02), A(tik_01), "ビッグゲッソ\ー チビゲッソ\ー"), {}, }; -StageList N(Stages) = { - STAGE("tik_01", N(tik_01)), - STAGE("tik_02", N(tik_02)), - STAGE("tik_03", N(tik_03)), - STAGE("tik_04", N(tik_04)), - STAGE("tik_05", N(tik_05)), +StageList A(Stages) = { + STAGE("tik_01", A(tik_01)), + STAGE("tik_02", A(tik_02)), + STAGE("tik_03", A(tik_03)), + STAGE("tik_04", A(tik_04)), + STAGE("tik_05", A(tik_05)), {}, }; diff --git a/src/battle/area/tik2/area.h b/src/battle/area/tik2/area.h new file mode 100644 index 0000000000..eed0d7a253 --- /dev/null +++ b/src/battle/area/tik2/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_tik2 diff --git a/src/battle/area/tik2/stage/tik_01.c b/src/battle/area/tik2/stage/tik_01.c index 13d77814bf..5104f8df7d 100644 --- a/src/battle/area/tik2/stage/tik_01.c +++ b/src/battle/area/tik2/stage/tik_01.c @@ -1,227 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_tik2_tik_01 - -#include "world/common/todo/UnkFunc56.inc.c" - -EvtScript N(802301F0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802302C0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802303AC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80230498) = { - EVT_SET(LVar1, ArrayVar(5)) - EVT_ADD(LVar1, 1) - EVT_SET(LVar2, ArrayVar(0)) - EVT_SET(LVar3, ArrayVar(1)) - EVT_SET(LVar4, ArrayVar(5)) - EVT_ADD(LVar4, 2) - EVT_SET(LVar5, ArrayVar(0)) - EVT_SET(LVar6, ArrayVar(1)) - EVT_SET(LVar7, ArrayVar(5)) - EVT_ADD(LVar7, 3) - EVT_SET(LVar8, ArrayVar(0)) - EVT_SET(LVar9, ArrayVar(1)) - EVT_SET(LVarA, ArrayVar(5)) - EVT_ADD(LVarA, 4) - EVT_SET(LVarB, ArrayVar(0)) - EVT_SET(LVarC, ArrayVar(1)) - EVT_CALL(EnableModel, LVar1, TRUE) - EVT_CALL(EnableModel, LVar4, TRUE) - EVT_CALL(EnableModel, LVar7, TRUE) - EVT_CALL(EnableModel, LVarA, TRUE) - EVT_LOOP(5) - EVT_ADD(LVar0, 1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_LOOP(5) - EVT_ADD(LVar0, -1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(EnableModel, LVar1, FALSE) - EVT_CALL(EnableModel, LVar4, FALSE) - EVT_CALL(EnableModel, LVar7, FALSE) - EVT_CALL(EnableModel, LVarA, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80230968) = { - EVT_SET_GROUP(0) - EVT_USE_ARRAY(LVarA) - EVT_SET(LVar5, ArrayVar(5)) - EVT_LOOP(5) - EVT_CALL(CloneModel, 16, LVar5) - EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) - EVT_ADD(LVar5, 1) - EVT_END_LOOP - EVT_LABEL(0) - EVT_CALL(RandInt, 200, LVar0) - EVT_ADD(LVar0, 50) - EVT_WAIT(LVar0) - EVT_CALL(EnableModel, ArrayVar(5), TRUE) - EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) - EVT_WAIT(1) - EVT_CALL(N(UnkFunc56), ArrayVar(5)) - EVT_IF_EQ(LVar2, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_LABEL(10) - EVT_CALL(EnableModel, ArrayVar(5), FALSE) - EVT_EXEC_WAIT(N(80230498)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80230B30) = { - EVT_SET(LVarF, 10000) - EVT_USE_BUF(LVar0) - EVT_BUF_READ1(LVar1) - EVT_LOOP(LVar1) - EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) - EVT_BUF_READ3(LVar6, LVar7, LVar8) - EVT_BUF_READ1(LVar9) - EVT_LOOP(LVar9) - EVT_MALLOC_ARRAY(6, LVarA) - EVT_USE_ARRAY(LVarA) - EVT_CALL(RandInt, LVar4, LVarB) - EVT_CALL(RandInt, LVar5, LVarC) - EVT_SET(LVarD, LVar2) - EVT_SET(LVarE, LVar3) - EVT_ADD(LVarD, LVarB) - EVT_ADD(LVarE, LVarC) - EVT_SET(ArrayVar(0), LVarD) - EVT_SET(ArrayVar(1), LVarE) - EVT_SET(ArrayVar(2), LVar6) - EVT_SET(ArrayVar(3), LVar7) - EVT_SET(ArrayVar(4), LVar8) - EVT_SET(ArrayVar(5), LVarF) - EVT_CHILD_THREAD - EVT_EXEC(N(80230968)) - EVT_END_CHILD_THREAD - EVT_ADD(LVarF, 5) - EVT_END_LOOP - EVT_END_LOOP - EVT_CALL(EnableModel, 16, FALSE) - EVT_RETURN - EVT_END -}; - -s32 N(80230CEC)[] = { - 1, -100, -50, 200, 100, 200, 0, 60, 4, -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, -500) - EVT_EXEC(N(802301F0)) - EVT_SET(LVar0, N(80230CEC)) - EVT_EXEC(N(80230B30)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt01_shape", - .hit = "tik_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_tik/tik_01.inc.c" diff --git a/src/battle/area/tik2/stage/tik_02.c b/src/battle/area/tik2/stage/tik_02.c index 89e522e4c5..dce698c893 100644 --- a/src/battle/area/tik2/stage/tik_02.c +++ b/src/battle/area/tik2/stage/tik_02.c @@ -1,227 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_tik2_tik_02 - -#include "world/common/todo/UnkFunc56.inc.c" - -EvtScript N(80230DF0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80230EC0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80230FAC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80231098) = { - EVT_SET(LVar1, ArrayVar(5)) - EVT_ADD(LVar1, 1) - EVT_SET(LVar2, ArrayVar(0)) - EVT_SET(LVar3, ArrayVar(1)) - EVT_SET(LVar4, ArrayVar(5)) - EVT_ADD(LVar4, 2) - EVT_SET(LVar5, ArrayVar(0)) - EVT_SET(LVar6, ArrayVar(1)) - EVT_SET(LVar7, ArrayVar(5)) - EVT_ADD(LVar7, 3) - EVT_SET(LVar8, ArrayVar(0)) - EVT_SET(LVar9, ArrayVar(1)) - EVT_SET(LVarA, ArrayVar(5)) - EVT_ADD(LVarA, 4) - EVT_SET(LVarB, ArrayVar(0)) - EVT_SET(LVarC, ArrayVar(1)) - EVT_CALL(EnableModel, LVar1, TRUE) - EVT_CALL(EnableModel, LVar4, TRUE) - EVT_CALL(EnableModel, LVar7, TRUE) - EVT_CALL(EnableModel, LVarA, TRUE) - EVT_LOOP(5) - EVT_ADD(LVar0, 1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_LOOP(5) - EVT_ADD(LVar0, -1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(EnableModel, LVar1, FALSE) - EVT_CALL(EnableModel, LVar4, FALSE) - EVT_CALL(EnableModel, LVar7, FALSE) - EVT_CALL(EnableModel, LVarA, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80231568) = { - EVT_SET_GROUP(0) - EVT_USE_ARRAY(LVarA) - EVT_SET(LVar5, ArrayVar(5)) - EVT_LOOP(5) - EVT_CALL(CloneModel, 16, LVar5) - EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) - EVT_ADD(LVar5, 1) - EVT_END_LOOP - EVT_LABEL(0) - EVT_CALL(RandInt, 200, LVar0) - EVT_ADD(LVar0, 50) - EVT_WAIT(LVar0) - EVT_CALL(EnableModel, ArrayVar(5), TRUE) - EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) - EVT_WAIT(1) - EVT_CALL(N(UnkFunc56), ArrayVar(5)) - EVT_IF_EQ(LVar2, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_LABEL(10) - EVT_CALL(EnableModel, ArrayVar(5), FALSE) - EVT_EXEC_WAIT(N(80231098)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80231730) = { - EVT_SET(LVarF, 10000) - EVT_USE_BUF(LVar0) - EVT_BUF_READ1(LVar1) - EVT_LOOP(LVar1) - EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) - EVT_BUF_READ3(LVar6, LVar7, LVar8) - EVT_BUF_READ1(LVar9) - EVT_LOOP(LVar9) - EVT_MALLOC_ARRAY(6, LVarA) - EVT_USE_ARRAY(LVarA) - EVT_CALL(RandInt, LVar4, LVarB) - EVT_CALL(RandInt, LVar5, LVarC) - EVT_SET(LVarD, LVar2) - EVT_SET(LVarE, LVar3) - EVT_ADD(LVarD, LVarB) - EVT_ADD(LVarE, LVarC) - EVT_SET(ArrayVar(0), LVarD) - EVT_SET(ArrayVar(1), LVarE) - EVT_SET(ArrayVar(2), LVar6) - EVT_SET(ArrayVar(3), LVar7) - EVT_SET(ArrayVar(4), LVar8) - EVT_SET(ArrayVar(5), LVarF) - EVT_CHILD_THREAD - EVT_EXEC(N(80231568)) - EVT_END_CHILD_THREAD - EVT_ADD(LVarF, 5) - EVT_END_LOOP - EVT_END_LOOP - EVT_CALL(EnableModel, 16, FALSE) - EVT_RETURN - EVT_END -}; - -s32 N(802318EC)[] = { - 1, -100, -50, 200, 100, 200, 0, 60, 4, -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, N(802318EC)) - EVT_EXEC(N(80231730)) - EVT_SET(LVar0, 14) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, -500) - EVT_EXEC(N(80230DF0)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt02_shape", - .hit = "tik_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_tik/tik_02.inc.c" diff --git a/src/battle/area/tik2/stage/tik_03.c b/src/battle/area/tik2/stage/tik_03.c index 5bd130fe75..6a6ff7fe81 100644 --- a/src/battle/area/tik2/stage/tik_03.c +++ b/src/battle/area/tik2/stage/tik_03.c @@ -1,170 +1,3 @@ -#include "common.h" -#include "battle/battle.h" - -#define NAMESPACE b_area_tik2_tik_03 - -#include "world/common/todo/UnkFunc56.inc.c" - -EvtScript N(802319F0) = { - EVT_SET(LVar1, ArrayVar(5)) - EVT_ADD(LVar1, 1) - EVT_SET(LVar2, ArrayVar(0)) - EVT_SET(LVar3, ArrayVar(1)) - EVT_SET(LVar4, ArrayVar(5)) - EVT_ADD(LVar4, 2) - EVT_SET(LVar5, ArrayVar(0)) - EVT_SET(LVar6, ArrayVar(1)) - EVT_SET(LVar7, ArrayVar(5)) - EVT_ADD(LVar7, 3) - EVT_SET(LVar8, ArrayVar(0)) - EVT_SET(LVar9, ArrayVar(1)) - EVT_SET(LVarA, ArrayVar(5)) - EVT_ADD(LVarA, 4) - EVT_SET(LVarB, ArrayVar(0)) - EVT_SET(LVarC, ArrayVar(1)) - EVT_CALL(EnableModel, LVar1, TRUE) - EVT_CALL(EnableModel, LVar4, TRUE) - EVT_CALL(EnableModel, LVar7, TRUE) - EVT_CALL(EnableModel, LVarA, TRUE) - EVT_LOOP(5) - EVT_ADD(LVar0, 1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_LOOP(5) - EVT_ADD(LVar0, -1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(EnableModel, LVar1, FALSE) - EVT_CALL(EnableModel, LVar4, FALSE) - EVT_CALL(EnableModel, LVar7, FALSE) - EVT_CALL(EnableModel, LVarA, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80231EC0) = { - EVT_SET_GROUP(0) - EVT_USE_ARRAY(LVarA) - EVT_SET(LVar5, ArrayVar(5)) - EVT_LOOP(5) - EVT_CALL(CloneModel, 18, LVar5) - EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) - EVT_ADD(LVar5, 1) - EVT_END_LOOP - EVT_LABEL(0) - EVT_CALL(RandInt, 200, LVar0) - EVT_ADD(LVar0, 50) - EVT_WAIT(LVar0) - EVT_CALL(EnableModel, ArrayVar(5), TRUE) - EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) - EVT_WAIT(1) - EVT_CALL(N(UnkFunc56), ArrayVar(5)) - EVT_IF_EQ(LVar2, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_LABEL(10) - EVT_CALL(EnableModel, ArrayVar(5), FALSE) - EVT_EXEC_WAIT(N(802319F0)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80232088) = { - EVT_SET(LVarF, 10000) - EVT_USE_BUF(LVar0) - EVT_BUF_READ1(LVar1) - EVT_LOOP(LVar1) - EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) - EVT_BUF_READ3(LVar6, LVar7, LVar8) - EVT_BUF_READ1(LVar9) - EVT_LOOP(LVar9) - EVT_MALLOC_ARRAY(6, LVarA) - EVT_USE_ARRAY(LVarA) - EVT_CALL(RandInt, LVar4, LVarB) - EVT_CALL(RandInt, LVar5, LVarC) - EVT_SET(LVarD, LVar2) - EVT_SET(LVarE, LVar3) - EVT_ADD(LVarD, LVarB) - EVT_ADD(LVarE, LVarC) - EVT_SET(ArrayVar(0), LVarD) - EVT_SET(ArrayVar(1), LVarE) - EVT_SET(ArrayVar(2), LVar6) - EVT_SET(ArrayVar(3), LVar7) - EVT_SET(ArrayVar(4), LVar8) - EVT_SET(ArrayVar(5), LVarF) - EVT_CHILD_THREAD - EVT_EXEC(N(80231EC0)) - EVT_END_CHILD_THREAD - EVT_ADD(LVarF, 5) - EVT_END_LOOP - EVT_END_LOOP - EVT_CALL(EnableModel, 18, FALSE) - EVT_RETURN - EVT_END -}; - -s32 N(80232244)[] = { - 1, -100, -50, 200, 100, 200, 0, 60, 4, -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, N(80232244)) - EVT_EXEC(N(80232088)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt03_shape", - .hit = "tik_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "../area.h" +#include "battle/common/stage/area_tik/tik_03.inc.c" diff --git a/src/battle/area/tik2/stage/tik_04.c b/src/battle/area/tik2/stage/tik_04.c index be9b72a607..b9b71e497d 100644 --- a/src/battle/area/tik2/stage/tik_04.c +++ b/src/battle/area/tik2/stage/tik_04.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" - -#define NAMESPACE b_area_tik2_tik_04 - -#include "battle/common/stage/lib/WaterEffects.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SET(LVar0, 15) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, 16) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, 17) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(5) - EVT_SET(LVar0, 9) - EVT_SET(LVar1, 145) - EVT_EXEC(N(script3)) - EVT_SET(LVar0, 10) - EVT_SET(LVar1, 145) - EVT_EXEC(N(script3)) - EVT_END_THREAD - EVT_SET(LVar0, 12) - EVT_SET(LVar1, 60) - EVT_EXEC(N(script3)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 60) - EVT_EXEC(N(script3)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt04_shape", - .hit = "tik_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; - +#include "../area.h" +#include "battle/common/stage/area_tik/tik_04.inc.c" diff --git a/src/battle/area/tik2/stage/tik_05.c b/src/battle/area/tik2/stage/tik_05.c index ce10b26776..ccb38f578d 100644 --- a/src/battle/area/tik2/stage/tik_05.c +++ b/src/battle/area/tik2/stage/tik_05.c @@ -1,52 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/tik_bt05_shape.h" - -#define NAMESPACE b_area_tik2_tik_05 - -#include "world/common/atomic/TexturePan.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetTexPanner, MODEL_taki1, TEX_PANNER_1) - EVT_CALL(EnableTexPanning, MODEL_taki1, TRUE) - EVT_THREAD - TEX_PAN_PARAMS_ID(TEX_PANNER_1) - TEX_PAN_PARAMS_STEP( 0, -2700, 0, -3000) - TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1) - TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) - EVT_EXEC(N(EVS_UpdateTexturePan)) - EVT_END_THREAD - EVT_CALL(SetTexPanner, MODEL_taki2, TEX_PANNER_2) - EVT_CALL(EnableTexPanning, MODEL_taki2, TRUE) - EVT_THREAD - TEX_PAN_PARAMS_ID(TEX_PANNER_2) - TEX_PAN_PARAMS_STEP( 50, -200, 110, -500) - TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1) - TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) - EVT_EXEC(N(EVS_UpdateTexturePan)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_taki1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt05_shape", - .hit = "tik_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "../area.h" +#include "battle/common/stage/area_tik/tik_05.inc.c" diff --git a/src/battle/area/tik3/actor/swooper.c b/src/battle/area/tik3/actor/swooper.c index 63915dc985..81a24f3134 100644 --- a/src/battle/area/tik3/actor/swooper.c +++ b/src/battle/area/tik3/actor/swooper.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_tik3_swooper +#include "../area.h" #include "battle/common/actor/swooper.inc.c" diff --git a/src/battle/area/tik3/actor/swoopula.c b/src/battle/area/tik3/actor/swoopula.c index 027b7d3dad..465ffaafe3 100644 --- a/src/battle/area/tik3/actor/swoopula.c +++ b/src/battle/area/tik3/actor/swoopula.c @@ -1,5 +1,3 @@ -#include "common.h" - -#define NAMESPACE b_area_tik3_swoopula +#include "../area.h" #include "battle/common/actor/swoopula.inc.c" diff --git a/src/battle/area/tik3/area.c b/src/battle/area/tik3/area.c index 9a1fd721cb..90ca4d51c0 100644 --- a/src/battle/area/tik3/area.c +++ b/src/battle/area/tik3/area.c @@ -1,52 +1,49 @@ -#include "common.h" -#include "battle/battle.h" +#include "area.h" -#define NAMESPACE b_area_tik3 +extern ActorBlueprint A(swooper); +extern ActorBlueprint A(swoopula); -extern ActorBlueprint N(swooper); -extern ActorBlueprint N(swoopula); +extern Stage A(tik_01); +extern Stage A(tik_02); +extern Stage A(tik_03); +extern Stage A(tik_04); +extern Stage A(tik_05); -extern Stage N(tik_01); -extern Stage N(tik_02); -extern Stage N(tik_03); -extern Stage N(tik_04); -extern Stage N(tik_05); - -Formation N(Formation_00) = { - ACTOR_BY_IDX(N(swooper), BTL_POS_TOP_B, 10), - ACTOR_BY_IDX(N(swooper), BTL_POS_TOP_C, 9), +Formation A(Formation_00) = { + ACTOR_BY_IDX(A(swooper), BTL_POS_TOP_B, 10), + ACTOR_BY_IDX(A(swooper), BTL_POS_TOP_C, 9), }; -Formation N(Formation_01) = { - ACTOR_BY_IDX(N(swooper), BTL_POS_TOP_A, 10), - ACTOR_BY_IDX(N(swooper), BTL_POS_TOP_B, 9), - ACTOR_BY_IDX(N(swooper), BTL_POS_TOP_C, 8), +Formation A(Formation_01) = { + ACTOR_BY_IDX(A(swooper), BTL_POS_TOP_A, 10), + ACTOR_BY_IDX(A(swooper), BTL_POS_TOP_B, 9), + ACTOR_BY_IDX(A(swooper), BTL_POS_TOP_C, 8), }; -Formation N(Formation_02) = { - ACTOR_BY_IDX(N(swoopula), BTL_POS_TOP_B, 10), - ACTOR_BY_IDX(N(swoopula), BTL_POS_TOP_C, 9), +Formation A(Formation_02) = { + ACTOR_BY_IDX(A(swoopula), BTL_POS_TOP_B, 10), + ACTOR_BY_IDX(A(swoopula), BTL_POS_TOP_C, 9), }; -Formation N(Formation_03) = { - ACTOR_BY_IDX(N(swoopula), BTL_POS_TOP_A, 10), - ACTOR_BY_IDX(N(swoopula), BTL_POS_TOP_B, 9), - ACTOR_BY_IDX(N(swoopula), BTL_POS_TOP_C, 8), +Formation A(Formation_03) = { + ACTOR_BY_IDX(A(swoopula), BTL_POS_TOP_A, 10), + ACTOR_BY_IDX(A(swoopula), BTL_POS_TOP_B, 9), + ACTOR_BY_IDX(A(swoopula), BTL_POS_TOP_C, 8), }; -BattleList N(Formations) = { - BATTLE(N(Formation_00), N(tik_01), "バサバサx2"), - BATTLE(N(Formation_01), N(tik_01), "バサバサx3"), - BATTLE(N(Formation_02), N(tik_01), "バサバサチュルルx2"), - BATTLE(N(Formation_03), N(tik_01), "バサバサチュルルx3"), +BattleList A(Formations) = { + BATTLE(A(Formation_00), A(tik_01), "バサバサx2"), + BATTLE(A(Formation_01), A(tik_01), "バサバサx3"), + BATTLE(A(Formation_02), A(tik_01), "バサバサチュルルx2"), + BATTLE(A(Formation_03), A(tik_01), "バサバサチュルルx3"), {}, }; -StageList N(Stages) = { - STAGE("tik_01", N(tik_01)), - STAGE("tik_02", N(tik_02)), - STAGE("tik_03", N(tik_03)), - STAGE("tik_04", N(tik_04)), - STAGE("tik_05", N(tik_05)), +StageList A(Stages) = { + STAGE("tik_01", A(tik_01)), + STAGE("tik_02", A(tik_02)), + STAGE("tik_03", A(tik_03)), + STAGE("tik_04", A(tik_04)), + STAGE("tik_05", A(tik_05)), {}, }; diff --git a/src/battle/area/tik3/area.h b/src/battle/area/tik3/area.h new file mode 100644 index 0000000000..19bb83353b --- /dev/null +++ b/src/battle/area/tik3/area.h @@ -0,0 +1,6 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" + +#define AREA b_area_tik3 diff --git a/src/battle/area/tik3/stage/tik_01.c b/src/battle/area/tik3/stage/tik_01.c index c858f1de23..5104f8df7d 100644 --- a/src/battle/area/tik3/stage/tik_01.c +++ b/src/battle/area/tik3/stage/tik_01.c @@ -1,227 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_tik3_tik_01 - -#include "world/common/todo/UnkFunc56.inc.c" - -EvtScript N(802301F0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802302C0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(802303AC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80230498) = { - EVT_SET(LVar1, ArrayVar(5)) - EVT_ADD(LVar1, 1) - EVT_SET(LVar2, ArrayVar(0)) - EVT_SET(LVar3, ArrayVar(1)) - EVT_SET(LVar4, ArrayVar(5)) - EVT_ADD(LVar4, 2) - EVT_SET(LVar5, ArrayVar(0)) - EVT_SET(LVar6, ArrayVar(1)) - EVT_SET(LVar7, ArrayVar(5)) - EVT_ADD(LVar7, 3) - EVT_SET(LVar8, ArrayVar(0)) - EVT_SET(LVar9, ArrayVar(1)) - EVT_SET(LVarA, ArrayVar(5)) - EVT_ADD(LVarA, 4) - EVT_SET(LVarB, ArrayVar(0)) - EVT_SET(LVarC, ArrayVar(1)) - EVT_CALL(EnableModel, LVar1, TRUE) - EVT_CALL(EnableModel, LVar4, TRUE) - EVT_CALL(EnableModel, LVar7, TRUE) - EVT_CALL(EnableModel, LVarA, TRUE) - EVT_LOOP(5) - EVT_ADD(LVar0, 1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_LOOP(5) - EVT_ADD(LVar0, -1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(EnableModel, LVar1, FALSE) - EVT_CALL(EnableModel, LVar4, FALSE) - EVT_CALL(EnableModel, LVar7, FALSE) - EVT_CALL(EnableModel, LVarA, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80230968) = { - EVT_SET_GROUP(0) - EVT_USE_ARRAY(LVarA) - EVT_SET(LVar5, ArrayVar(5)) - EVT_LOOP(5) - EVT_CALL(CloneModel, 16, LVar5) - EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) - EVT_ADD(LVar5, 1) - EVT_END_LOOP - EVT_LABEL(0) - EVT_CALL(RandInt, 200, LVar0) - EVT_ADD(LVar0, 50) - EVT_WAIT(LVar0) - EVT_CALL(EnableModel, ArrayVar(5), TRUE) - EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) - EVT_WAIT(1) - EVT_CALL(N(UnkFunc56), ArrayVar(5)) - EVT_IF_EQ(LVar2, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_LABEL(10) - EVT_CALL(EnableModel, ArrayVar(5), FALSE) - EVT_EXEC_WAIT(N(80230498)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80230B30) = { - EVT_SET(LVarF, 10000) - EVT_USE_BUF(LVar0) - EVT_BUF_READ1(LVar1) - EVT_LOOP(LVar1) - EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) - EVT_BUF_READ3(LVar6, LVar7, LVar8) - EVT_BUF_READ1(LVar9) - EVT_LOOP(LVar9) - EVT_MALLOC_ARRAY(6, LVarA) - EVT_USE_ARRAY(LVarA) - EVT_CALL(RandInt, LVar4, LVarB) - EVT_CALL(RandInt, LVar5, LVarC) - EVT_SET(LVarD, LVar2) - EVT_SET(LVarE, LVar3) - EVT_ADD(LVarD, LVarB) - EVT_ADD(LVarE, LVarC) - EVT_SET(ArrayVar(0), LVarD) - EVT_SET(ArrayVar(1), LVarE) - EVT_SET(ArrayVar(2), LVar6) - EVT_SET(ArrayVar(3), LVar7) - EVT_SET(ArrayVar(4), LVar8) - EVT_SET(ArrayVar(5), LVarF) - EVT_CHILD_THREAD - EVT_EXEC(N(80230968)) - EVT_END_CHILD_THREAD - EVT_ADD(LVarF, 5) - EVT_END_LOOP - EVT_END_LOOP - EVT_CALL(EnableModel, 16, FALSE) - EVT_RETURN - EVT_END -}; - -s32 N(80230CEC)[] = { - 1, -100, -50, 200, 100, 200, 0, 60, 4, -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, -500) - EVT_EXEC(N(802301F0)) - EVT_SET(LVar0, N(80230CEC)) - EVT_EXEC(N(80230B30)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt01_shape", - .hit = "tik_bt01_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_tik/tik_01.inc.c" diff --git a/src/battle/area/tik3/stage/tik_02.c b/src/battle/area/tik3/stage/tik_02.c index 3a7c1cd854..dce698c893 100644 --- a/src/battle/area/tik3/stage/tik_02.c +++ b/src/battle/area/tik3/stage/tik_02.c @@ -1,227 +1,3 @@ -#include "common.h" -#include "battle/battle.h" +#include "../area.h" -#define NAMESPACE b_area_tik3_tik_02 - -#include "world/common/todo/UnkFunc56.inc.c" - -EvtScript N(80230DF0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80230EC0) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, LVar0, 0) - EVT_CALL(SetTexPanOffset, LVarA, 1, LVar1, 0) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80230FAC) = { - EVT_SET(LVarA, LVar1) - EVT_SET(LVarB, LVar2) - EVT_SET(LVarC, LVar3) - EVT_CALL(SetTexPanner, LVar0, LVar1) - EVT_SET(LVar0, 0) - EVT_SET(LVar1, 0) - EVT_LOOP(0) - EVT_CALL(SetTexPanOffset, LVarA, 0, 0, LVar0) - EVT_CALL(SetTexPanOffset, LVarA, 1, 0, LVar1) - EVT_ADD(LVar0, LVarB) - EVT_ADD(LVar1, LVarC) - EVT_WAIT(1) - EVT_END_LOOP - EVT_RETURN - EVT_END -}; - -EvtScript N(80231098) = { - EVT_SET(LVar1, ArrayVar(5)) - EVT_ADD(LVar1, 1) - EVT_SET(LVar2, ArrayVar(0)) - EVT_SET(LVar3, ArrayVar(1)) - EVT_SET(LVar4, ArrayVar(5)) - EVT_ADD(LVar4, 2) - EVT_SET(LVar5, ArrayVar(0)) - EVT_SET(LVar6, ArrayVar(1)) - EVT_SET(LVar7, ArrayVar(5)) - EVT_ADD(LVar7, 3) - EVT_SET(LVar8, ArrayVar(0)) - EVT_SET(LVar9, ArrayVar(1)) - EVT_SET(LVarA, ArrayVar(5)) - EVT_ADD(LVarA, 4) - EVT_SET(LVarB, ArrayVar(0)) - EVT_SET(LVarC, ArrayVar(1)) - EVT_CALL(EnableModel, LVar1, TRUE) - EVT_CALL(EnableModel, LVar4, TRUE) - EVT_CALL(EnableModel, LVar7, TRUE) - EVT_CALL(EnableModel, LVarA, TRUE) - EVT_LOOP(5) - EVT_ADD(LVar0, 1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_LOOP(5) - EVT_ADD(LVar0, -1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(EnableModel, LVar1, FALSE) - EVT_CALL(EnableModel, LVar4, FALSE) - EVT_CALL(EnableModel, LVar7, FALSE) - EVT_CALL(EnableModel, LVarA, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80231568) = { - EVT_SET_GROUP(0) - EVT_USE_ARRAY(LVarA) - EVT_SET(LVar5, ArrayVar(5)) - EVT_LOOP(5) - EVT_CALL(CloneModel, 16, LVar5) - EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) - EVT_ADD(LVar5, 1) - EVT_END_LOOP - EVT_LABEL(0) - EVT_CALL(RandInt, 200, LVar0) - EVT_ADD(LVar0, 50) - EVT_WAIT(LVar0) - EVT_CALL(EnableModel, ArrayVar(5), TRUE) - EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) - EVT_WAIT(1) - EVT_CALL(N(UnkFunc56), ArrayVar(5)) - EVT_IF_EQ(LVar2, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_LABEL(10) - EVT_CALL(EnableModel, ArrayVar(5), FALSE) - EVT_EXEC_WAIT(N(80231098)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80231730) = { - EVT_SET(LVarF, 10000) - EVT_USE_BUF(LVar0) - EVT_BUF_READ1(LVar1) - EVT_LOOP(LVar1) - EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) - EVT_BUF_READ3(LVar6, LVar7, LVar8) - EVT_BUF_READ1(LVar9) - EVT_LOOP(LVar9) - EVT_MALLOC_ARRAY(6, LVarA) - EVT_USE_ARRAY(LVarA) - EVT_CALL(RandInt, LVar4, LVarB) - EVT_CALL(RandInt, LVar5, LVarC) - EVT_SET(LVarD, LVar2) - EVT_SET(LVarE, LVar3) - EVT_ADD(LVarD, LVarB) - EVT_ADD(LVarE, LVarC) - EVT_SET(ArrayVar(0), LVarD) - EVT_SET(ArrayVar(1), LVarE) - EVT_SET(ArrayVar(2), LVar6) - EVT_SET(ArrayVar(3), LVar7) - EVT_SET(ArrayVar(4), LVar8) - EVT_SET(ArrayVar(5), LVarF) - EVT_CHILD_THREAD - EVT_EXEC(N(80231568)) - EVT_END_CHILD_THREAD - EVT_ADD(LVarF, 5) - EVT_END_LOOP - EVT_END_LOOP - EVT_CALL(EnableModel, 16, FALSE) - EVT_RETURN - EVT_END -}; - -s32 N(802318EC)[] = { - 1, -100, -50, 200, 100, 200, 0, 60, 4, -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, N(802318EC)) - EVT_EXEC(N(80231730)) - EVT_SET(LVar0, 14) - EVT_SET(LVar1, 0) - EVT_SET(LVar2, 0) - EVT_SET(LVar3, -500) - EVT_EXEC(N(80230DF0)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt02_shape", - .hit = "tik_bt02_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "battle/common/stage/area_tik/tik_02.inc.c" diff --git a/src/battle/area/tik3/stage/tik_03.c b/src/battle/area/tik3/stage/tik_03.c index 87af11e79a..6a6ff7fe81 100644 --- a/src/battle/area/tik3/stage/tik_03.c +++ b/src/battle/area/tik3/stage/tik_03.c @@ -1,170 +1,3 @@ -#include "common.h" -#include "battle/battle.h" - -#define NAMESPACE b_area_tik3_tik_03 - -#include "world/common/todo/UnkFunc56.inc.c" - -EvtScript N(802319F0) = { - EVT_SET(LVar1, ArrayVar(5)) - EVT_ADD(LVar1, 1) - EVT_SET(LVar2, ArrayVar(0)) - EVT_SET(LVar3, ArrayVar(1)) - EVT_SET(LVar4, ArrayVar(5)) - EVT_ADD(LVar4, 2) - EVT_SET(LVar5, ArrayVar(0)) - EVT_SET(LVar6, ArrayVar(1)) - EVT_SET(LVar7, ArrayVar(5)) - EVT_ADD(LVar7, 3) - EVT_SET(LVar8, ArrayVar(0)) - EVT_SET(LVar9, ArrayVar(1)) - EVT_SET(LVarA, ArrayVar(5)) - EVT_ADD(LVarA, 4) - EVT_SET(LVarB, ArrayVar(0)) - EVT_SET(LVarC, ArrayVar(1)) - EVT_CALL(EnableModel, LVar1, TRUE) - EVT_CALL(EnableModel, LVar4, TRUE) - EVT_CALL(EnableModel, LVar7, TRUE) - EVT_CALL(EnableModel, LVarA, TRUE) - EVT_LOOP(5) - EVT_ADD(LVar0, 1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_LOOP(5) - EVT_ADD(LVar0, -1) - EVT_ADD(LVar2, 1) - EVT_ADD(LVar3, 1) - EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) - EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar5, -1) - EVT_ADD(LVar6, 1) - EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) - EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVar8, 1) - EVT_ADD(LVar9, -1) - EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) - EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_ADD(LVarB, -1) - EVT_ADD(LVarC, -1) - EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) - EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(EnableModel, LVar1, FALSE) - EVT_CALL(EnableModel, LVar4, FALSE) - EVT_CALL(EnableModel, LVar7, FALSE) - EVT_CALL(EnableModel, LVarA, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(80231EC0) = { - EVT_SET_GROUP(0) - EVT_USE_ARRAY(LVarA) - EVT_SET(LVar5, ArrayVar(5)) - EVT_LOOP(5) - EVT_CALL(CloneModel, 18, LVar5) - EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) - EVT_ADD(LVar5, 1) - EVT_END_LOOP - EVT_LABEL(0) - EVT_CALL(RandInt, 200, LVar0) - EVT_ADD(LVar0, 50) - EVT_WAIT(LVar0) - EVT_CALL(EnableModel, ArrayVar(5), TRUE) - EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) - EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) - EVT_WAIT(1) - EVT_CALL(N(UnkFunc56), ArrayVar(5)) - EVT_IF_EQ(LVar2, 1) - EVT_GOTO(10) - EVT_END_IF - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF - EVT_LABEL(10) - EVT_CALL(EnableModel, ArrayVar(5), FALSE) - EVT_EXEC_WAIT(N(802319F0)) - EVT_GOTO(0) - EVT_RETURN - EVT_END -}; - -EvtScript N(80232088) = { - EVT_SET(LVarF, 10000) - EVT_USE_BUF(LVar0) - EVT_BUF_READ1(LVar1) - EVT_LOOP(LVar1) - EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) - EVT_BUF_READ3(LVar6, LVar7, LVar8) - EVT_BUF_READ1(LVar9) - EVT_LOOP(LVar9) - EVT_MALLOC_ARRAY(6, LVarA) - EVT_USE_ARRAY(LVarA) - EVT_CALL(RandInt, LVar4, LVarB) - EVT_CALL(RandInt, LVar5, LVarC) - EVT_SET(LVarD, LVar2) - EVT_SET(LVarE, LVar3) - EVT_ADD(LVarD, LVarB) - EVT_ADD(LVarE, LVarC) - EVT_SET(ArrayVar(0), LVarD) - EVT_SET(ArrayVar(1), LVarE) - EVT_SET(ArrayVar(2), LVar6) - EVT_SET(ArrayVar(3), LVar7) - EVT_SET(ArrayVar(4), LVar8) - EVT_SET(ArrayVar(5), LVarF) - EVT_CHILD_THREAD - EVT_EXEC(N(80231EC0)) - EVT_END_CHILD_THREAD - EVT_ADD(LVarF, 5) - EVT_END_LOOP - EVT_END_LOOP - EVT_CALL(EnableModel, 18, FALSE) - EVT_RETURN - EVT_END -}; - -s32 N(80232244)[] = { - 1, -100, -50, 200, 100, 200, 0, 60, 4, -}; - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_SET(LVar0, N(80232244)) - EVT_EXEC(N(80232088)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt03_shape", - .hit = "tik_bt03_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; +#include "../area.h" +#include "battle/common/stage/area_tik/tik_03.inc.c" diff --git a/src/battle/area/tik3/stage/tik_04.c b/src/battle/area/tik3/stage/tik_04.c index 653459edea..b9b71e497d 100644 --- a/src/battle/area/tik3/stage/tik_04.c +++ b/src/battle/area/tik3/stage/tik_04.c @@ -1,53 +1,3 @@ -#include "common.h" -#include "battle/battle.h" - -#define NAMESPACE b_area_tik3_tik_04 - -#include "battle/common/stage/lib/WaterEffects.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_THREAD - EVT_SET(LVar0, 15) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, 16) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_WAIT(5) - EVT_SET(LVar0, 17) - EVT_EXEC(N(EVS_AnimateWaveModel)) - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(5) - EVT_SET(LVar0, 9) - EVT_SET(LVar1, 145) - EVT_EXEC(N(script3)) - EVT_SET(LVar0, 10) - EVT_SET(LVar1, 145) - EVT_EXEC(N(script3)) - EVT_END_THREAD - EVT_SET(LVar0, 12) - EVT_SET(LVar1, 60) - EVT_EXEC(N(script3)) - EVT_SET(LVar0, 13) - EVT_SET(LVar1, 60) - EVT_EXEC(N(script3)) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt04_shape", - .hit = "tik_bt04_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), -}; - +#include "../area.h" +#include "battle/common/stage/area_tik/tik_04.inc.c" diff --git a/src/battle/area/tik3/stage/tik_05.c b/src/battle/area/tik3/stage/tik_05.c index 1dd890a5a6..ccb38f578d 100644 --- a/src/battle/area/tik3/stage/tik_05.c +++ b/src/battle/area/tik3/stage/tik_05.c @@ -1,52 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "mapfs/tik_bt05_shape.h" - -#define NAMESPACE b_area_tik3_tik_05 - -#include "world/common/atomic/TexturePan.inc.c" - -EvtScript N(EVS_PreBattle) = { - EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetTexPanner, MODEL_taki1, TEX_PANNER_1) - EVT_CALL(EnableTexPanning, MODEL_taki1, TRUE) - EVT_THREAD - TEX_PAN_PARAMS_ID(TEX_PANNER_1) - TEX_PAN_PARAMS_STEP( 0, -2700, 0, -3000) - TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1) - TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) - EVT_EXEC(N(EVS_UpdateTexturePan)) - EVT_END_THREAD - EVT_CALL(SetTexPanner, MODEL_taki2, TEX_PANNER_2) - EVT_CALL(EnableTexPanning, MODEL_taki2, TRUE) - EVT_THREAD - TEX_PAN_PARAMS_ID(TEX_PANNER_2) - TEX_PAN_PARAMS_STEP( 50, -200, 110, -500) - TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1) - TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) - EVT_EXEC(N(EVS_UpdateTexturePan)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_PostBattle) = { - EVT_RETURN - EVT_END -}; - -s32 N(ForegroundModels)[] = { - MODEL_taki1, - STAGE_MODEL_LIST_END -}; - -Stage NAMESPACE = { - .texture = "tik_tex", - .shape = "tik_bt05_shape", - .hit = "tik_bt05_hit", - .preBattle = &N(EVS_PreBattle), - .postBattle = &N(EVS_PostBattle), - .foregroundModelList = N(ForegroundModels), -}; +#include "../area.h" +#include "battle/common/stage/area_tik/tik_05.inc.c" diff --git a/src/battle/area/trd_part_1/actor/bill_blaster.c b/src/battle/area/trd_part_1/actor/bill_blaster.c index a50778d13f..90660e39c7 100644 --- a/src/battle/area/trd_part_1/actor/bill_blaster.c +++ b/src/battle/area/trd_part_1/actor/bill_blaster.c @@ -1,251 +1,3 @@ #include "../area.h" -#include "sprite/npc/BillBlaster.h" -#define NAMESPACE A(bill_blaster) - -extern EvtScript N(EVS_Init); -extern EvtScript N(EVS_Idle); -extern EvtScript N(EVS_TakeTurn); -extern EvtScript N(EVS_HandleEvent); -extern EvtScript N(EVS_Move_FireBullet); -extern EvtScript N(EVS_Move_CheckForBullet); -extern s32 N(DefaultAnims)[]; - -extern ActorBlueprint A(bullet_bill); -extern Formation N(BulletBillSummon); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_TARGET = 2, -}; - -enum N(ActorVars) { - AVAR_BulletID = 0, - AVAR_HasBullet = 8, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 1, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 0, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 0, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 0, - STATUS_KEY_SHRINK, 50, - STATUS_KEY_STOP, 0, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { -6, 29 }, - .opacity = 255, - .idleAnimations = N(DefaultAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -9 }, - }, - { - .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_MULTI_TARGET | ACTOR_PART_FLAG_80000000, - .index = PRT_TARGET, - .posOffset = { 100, 0, 0 }, - .targetOffset = { -106, 29 }, - .opacity = 255, - .idleAnimations = N(DefaultAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAGS_NONE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -9 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_BILL_BLASTER, - .level = 10, - .maxHP = 4, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(EVS_Init), - .statusTable = N(StatusTable), - .escapeChance = 0, - .airLiftChance = 20, - .hurricaneChance = 15, - .spookChance = 0, - .upAndAwayChance = 95, - .spinSmashReq = 4, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 55, 32 }, - .healthBarOffset = { 8, 0 }, - .statusIconOffset = { -24, 20 }, - .statusTextOffset = { 5, 25 }, -}; - -s32 N(DefaultAnims)[] = { - STATUS_KEY_NORMAL, ANIM_BillBlaster_Idle, - STATUS_KEY_STONE, ANIM_BillBlaster_Still, - STATUS_KEY_STOP, ANIM_BillBlaster_Still, - STATUS_KEY_PARALYZE, ANIM_BillBlaster_Still, - STATUS_END, -}; - -EvtScript N(EVS_Init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HasBullet, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Idle) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_HandleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) - EVT_SET_CONST(LVar2, -1) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_TakeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_HasBullet, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(EVS_Move_FireBullet)) - EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(EVS_Move_CheckForBullet)) - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -API_CALLABLE(N(SetBulletInitVars)) { - N(BulletBillSummon)[0].var0 = TRUE; - N(BulletBillSummon)[0].var1 = script->owner1.actorID; - - return ApiStatus_DONE2; -} - -EvtScript N(EVS_Move_FireBullet) = { - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BillBlaster_Fire) - EVT_WAIT(13) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 10, EVT_FLOAT(1.0)) - EVT_END_THREAD - EVT_CALL(StartRumble, 9) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2C8) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 33) - EVT_ADD(LVar1, 19) - EVT_ADD(LVar2, 3) - EVT_PLAY_EFFECT(EFFECT_00, LVar0, LVar1, LVar2, 2, 5, 0, 2, 0) - EVT_PLAY_EFFECT(EFFECT_00, LVar0, LVar1, LVar2, 2, 5, 2, 2, 0) - EVT_WAIT(2) - EVT_CALL(N(SetBulletInitVars)) - EVT_CALL(SummonEnemy, EVT_PTR(N(BulletBillSummon)), 0) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_BulletID, LVar0) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HasBullet, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Move_CheckForBullet) = { - EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_BulletID, LVar0) - EVT_CALL(ActorExists, LVar0, LVar1) - EVT_IF_EQ(LVar1, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HasBullet, FALSE) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -Vec3i N(DefaultPos) = { NPC_DISPOSE_LOCATION }; - -Formation N(BulletBillSummon) = { - ACTOR_BY_POS(A(bullet_bill), N(DefaultPos), 100), -}; +#include "battle/common/actor/bill_blaster.inc.c" diff --git a/src/battle/area/trd_part_1/actor/bob_omb.c b/src/battle/area/trd_part_1/actor/bob_omb.c index f9ff4e0070..9a92602df6 100644 --- a/src/battle/area/trd_part_1/actor/bob_omb.c +++ b/src/battle/area/trd_part_1/actor/bob_omb.c @@ -1,701 +1,3 @@ #include "../area.h" -#include "sprite/npc/Bobomb.h" -#define NAMESPACE A(bob_omb) - -extern EvtScript N(EVS_Init); -extern EvtScript N(EVS_Idle); -extern EvtScript N(EVS_TakeTurn); -extern EvtScript N(EVS_HandleEvent); -extern EvtScript N(EVS_HandleEvent_Ignited); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -enum N(ActorVars) { - AVAR_0 = 0, - AVAR_Ignited = 8, -}; - -enum N(ActorParams) { - DMG_TACKLE = 1, - DMG_EXPLOSION = 2, -}; - -s32 N(DefaultAnims)[] = { - STATUS_KEY_NORMAL, ANIM_Bobomb_Idle, - STATUS_KEY_STONE, ANIM_Bobomb_Still, - STATUS_KEY_SLEEP, ANIM_Bobomb_Sleep, - STATUS_KEY_POISON, ANIM_Bobomb_Walk, - STATUS_KEY_STOP, ANIM_Bobomb_Still, - STATUS_KEY_STATIC, ANIM_Bobomb_Idle, - STATUS_KEY_PARALYZE, ANIM_Bobomb_Still, - STATUS_KEY_DIZZY, ANIM_Bobomb_Dizzy, - STATUS_KEY_FEAR, ANIM_Bobomb_Dizzy, - STATUS_END, -}; - -s32 N(IgnitedAnims)[] = { - STATUS_KEY_NORMAL, ANIM_Bobomb_WalkLit, - STATUS_KEY_STONE, ANIM_Bobomb_StillLit, - STATUS_KEY_SLEEP, ANIM_Bobomb_Sleep, - STATUS_KEY_POISON, ANIM_Bobomb_WalkLit, - STATUS_KEY_STOP, ANIM_Bobomb_StillLit, - STATUS_KEY_STATIC, ANIM_Bobomb_IdleLit, - STATUS_KEY_PARALYZE, ANIM_Bobomb_StillLit, - STATUS_KEY_DIZZY, ANIM_Bobomb_DizzyLit, - STATUS_KEY_FEAR, ANIM_Bobomb_DizzyLit, - STATUS_END, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 75, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 80, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 80, - STATUS_KEY_SHRINK, 90, - STATUS_KEY_STOP, 90, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -s32 N(StatusTable_Ignited)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 0, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 0, - STATUS_KEY_DIZZY, 40, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 40, - STATUS_KEY_SHRINK, 0, - STATUS_KEY_STOP, 0, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 0, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 24 }, - .opacity = 255, - .idleAnimations = N(DefaultAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -9 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = 0, - .type = ACTOR_TYPE_BOB_OMB, - .level = 6, - .maxHP = 3, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(EVS_Init), - .statusTable = N(StatusTable), - .escapeChance = 70, - .airLiftChance = 90, - .hurricaneChance = 90, - .spookChance = 90, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 100, - .coinReward = 1, - .size = { 34, 35 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -EvtScript N(EVS_Init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Ignited, FALSE) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_0, FALSE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Idle) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Ignite) = { - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) - EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_RETURN - EVT_END_IF - EVT_LABEL(0) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Ignited, TRUE) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IgnitedAnims))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent_Ignited))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_CONTACT, TRUE) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_Ignited))) - EVT_CALL(PlayLoopingSoundAtActor, ACTOR_SELF, 0, SOUND_80000001) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_WalkLit) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, 0, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(func_8026ED20, ACTOR_SELF, PRT_MAIN, 1) - EVT_CALL(SetActorPaletteSwapParams, ACTOR_SELF, PRT_MAIN, SPR_PAL_Bobomb, SPR_PAL_Bobomb_Burst, 0, 10, 0, 10, 0, 0) - EVT_CALL(SetActorPaletteEffect, ACTOR_SELF, PRT_MAIN, PAL_ADJUST_BLEND_PALETTES_VARYING_INTERVALS) - EVT_WAIT(3) - EVT_CALL(StopLoopingSoundAtActor, ACTOR_SELF, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Defuse) = { - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Ignited, FALSE) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) - EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_CONTACT, FALSE) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable))) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar2, 2) - EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 3, LVar0, LVar1, LVar2, 0, 0) - EVT_CALL(StopLoopingSoundAtActor, ACTOR_SELF, 0) - EVT_CALL(func_8026ED20, ACTOR_SELF, PRT_MAIN, 0) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Cleanup) = { - EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Ignited, LVar0) - EVT_IF_EQ(LVar0, TRUE) - EVT_CALL(StopLoopingSoundAtActor, ACTOR_SELF, 0) - EVT_CALL(func_8026ED20, ACTOR_SELF, PRT_MAIN, 0) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Explode) = { - EVT_EXEC_WAIT(N(EVS_Cleanup)) - EVT_CALL(StartRumble, 11) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 2, EVT_FLOAT(0.75)) - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(3.0)) - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 10, EVT_FLOAT(4.5)) - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(3.0)) - EVT_END_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar2, 2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_RING, 0, LVar0, LVar1, LVar2, 0) - EVT_ADD(LVar1, 20) - EVT_ADD(LVar2, 2) - EVT_PLAY_EFFECT(EFFECT_EXPLOSION, 0, LVar0, LVar1, LVar2, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BOMB_BLAST) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_HandleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) - EVT_IF_NE(LVar0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_0, TRUE) - EVT_END_IF - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CASE_EQ(EVENT_HIT) - EVT_CALL(GetLastElement, LVarE) - EVT_IF_FLAG(LVarE, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Bobomb_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_ELSE - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) - EVT_IF_NE(LVar0, 0) - EVT_EXEC_WAIT(N(EVS_Ignite)) - EVT_END_IF - EVT_END_IF - EVT_CASE_OR_EQ(EVENT_BURN_HIT) - EVT_CASE_OR_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Bobomb_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) - EVT_IF_NE(LVar0, 0) - EVT_EXEC_WAIT(N(EVS_Ignite)) - EVT_END_IF - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_EXEC_WAIT(N(EVS_Cleanup)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_SHOCK_HIT) - EVT_CASE_OR_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_0, LVar0) - EVT_IF_EQ(LVar0, TRUE) - EVT_EXEC_WAIT(N(EVS_Ignite)) - EVT_END_IF - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_CALL(GetLastElement, LVarE) - EVT_IF_FLAG(LVarE, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Bobomb_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_ELSE - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_EXEC_WAIT(N(EVS_Cleanup)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_END_IF - EVT_RETURN - EVT_CASE_EQ(EVENT_EXPLODE_TRIGGER) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Bobomb_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Run) - EVT_SET_CONST(LVar2, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Dizzy) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Dizzy) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_HandleEvent_Ignited) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_CALL(GetLastElement, LVarE) - EVT_IF_FLAG(LVarE, DAMAGE_TYPE_WATER) - EVT_EXEC_WAIT(N(EVS_Defuse)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_ELSE - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_HurtLit) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_IF - EVT_CASE_EQ(EVENT_HIT) - EVT_CALL(GetLastElement, LVarE) - EVT_SWITCH(LVarE) - EVT_CASE_FLAG(DAMAGE_TYPE_WATER) - EVT_EXEC_WAIT(N(EVS_Defuse)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CASE_FLAG(DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_HurtLit) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) - EVT_IF_GT(LVar0, 0) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_END_IF - EVT_END_SWITCH - EVT_CASE_OR_EQ(EVENT_BURN_HIT) - EVT_CASE_OR_EQ(EVENT_BURN_DEATH) - EVT_CASE_OR_EQ(EVENT_SPIN_SMASH_HIT) - EVT_CASE_OR_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_CASE_OR_EQ(EVENT_EXPLODE_TRIGGER) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_IdleLit) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_CALL(GetLastElement, LVarE) - EVT_IF_FLAG(LVarE, DAMAGE_TYPE_WATER) - EVT_EXEC_WAIT(N(EVS_Defuse)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) - EVT_ELSE - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_SHOCK_HIT) - EVT_CASE_OR_EQ(EVENT_SHOCK_DEATH) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_IdleLit) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_EXEC_WAIT(N(EVS_Cleanup)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Run) - EVT_SET_CONST(LVar2, ANIM_Bobomb_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_DizzyLit) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetDamageSource, LVar0) - EVT_IF_EQ(LVar0, DMG_SRC_HURRICANE) - EVT_EXEC_WAIT(N(EVS_Defuse)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_Dizzy) - EVT_ELSE - EVT_CHILD_THREAD - EVT_WAIT(100) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_END_CHILD_THREAD - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_DizzyLit) - EVT_END_IF - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_UP_AND_AWAY) - EVT_EXEC_WAIT(N(EVS_Defuse)) - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Attack_Tackle) = { - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Idle) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Run) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Dizzy) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 20) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 15) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_WAIT(8) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(5) - EVT_CALL(YieldTurn) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Idle) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_EQ(HIT_RESULT_HIT_STATIC) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Buildup) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) - EVT_PLAY_EFFECT(EFFECT_FLASHING_BOX_SHOCKWAVE, 0, LVar0, LVar1, LVar2, LVar4, LVar3, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_SHOCK) - EVT_WAIT(20) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_BLAST, 0, 0, DMG_EXPLOSION, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_RETURN - EVT_END_SWITCH - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_TACKLE, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Idle) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_WAIT(4) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Idle) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Attack_Blast) = { - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(PlayLoopingSoundAtActor, ACTOR_SELF, 0, SOUND_80000001) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_RunLit) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 80, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, -1, 14, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 90) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_RunLit) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_BurnStill) - EVT_WAIT(10) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(10) - EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, -1) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_RunLit) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 10, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Buildup) - EVT_WAIT(15) - EVT_SET(LVarA, 1) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_BurnStill) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_BLAST | DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_EXPLOSION, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_WAIT(15) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_TakeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Ignited, LVar0) - EVT_IF_FALSE(LVar0) - EVT_EXEC_WAIT(N(EVS_Attack_Tackle)) - EVT_ELSE - EVT_EXEC_WAIT(N(EVS_Attack_Blast)) - EVT_RETURN - EVT_END_IF - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/bob_omb.inc.c" diff --git a/src/battle/area/trd_part_1/actor/bullet_bill.c b/src/battle/area/trd_part_1/actor/bullet_bill.c index e008f1b381..3bb0595a15 100644 --- a/src/battle/area/trd_part_1/actor/bullet_bill.c +++ b/src/battle/area/trd_part_1/actor/bullet_bill.c @@ -1,313 +1,3 @@ #include "../area.h" -#include "sprite/npc/BulletBill.h" -#define NAMESPACE A(bullet_bill) - -extern s32 N(DefaultAnims)[]; -extern EvtScript N(EVS_Init); -extern EvtScript N(EVS_TakeTurn); -extern EvtScript N(EVS_Idle); -extern EvtScript N(EVS_HandleEvent); -extern EvtScript N(EVS_MakeExplosionFX); - -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -enum N(ActorVars) { - AVAR_FiredFromBlaster = 0, - AVAR_BlasterID = 1, // actorID of Bill Blaster that fired this Bullet Bill -}; - -enum N(ActorParams) { - DMG_IMPACT = 2, -}; - -s32 N(DefenseTable)[] = { - ELEMENT_NORMAL, 0, - ELEMENT_END, -}; - -s32 N(StatusTable)[] = { - STATUS_KEY_NORMAL, 0, - STATUS_KEY_DEFAULT, 0, - STATUS_KEY_SLEEP, 0, - STATUS_KEY_POISON, 0, - STATUS_KEY_FROZEN, 100, - STATUS_KEY_DIZZY, 100, - STATUS_KEY_FEAR, 0, - STATUS_KEY_STATIC, 0, - STATUS_KEY_PARALYZE, 0, - STATUS_KEY_SHRINK, 100, - STATUS_KEY_STOP, 0, - STATUS_TURN_MOD_DEFAULT, 0, - STATUS_TURN_MOD_SLEEP, 0, - STATUS_TURN_MOD_POISON, 0, - STATUS_TURN_MOD_FROZEN, 0, - STATUS_TURN_MOD_DIZZY, 1, - STATUS_TURN_MOD_FEAR, 0, - STATUS_TURN_MOD_STATIC, 0, - STATUS_TURN_MOD_PARALYZE, 0, - STATUS_TURN_MOD_SHRINK, 0, - STATUS_TURN_MOD_STOP, 0, - STATUS_END, -}; - -ActorPartBlueprint N(ActorParts)[] = { - { - .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_MAIN, - .posOffset = { 0, 0, 0 }, - .targetOffset = { 0, 16 }, - .opacity = 255, - .idleAnimations = N(DefaultAnims), - .defenseTable = N(DefenseTable), - .eventFlags = ACTOR_EVENT_FLAG_FIRE_EXPLODE, - .elementImmunityFlags = 0, - .projectileTargetOffset = { 0, -6 }, - }, -}; - -ActorBlueprint NAMESPACE = { - .flags = ACTOR_FLAG_FLYING, - .type = ACTOR_TYPE_BULLET_BILL, - .level = 5, - .maxHP = 2, - .partCount = ARRAY_COUNT( N(ActorParts)), - .partsData = N(ActorParts), - .initScript = &N(EVS_Init), - .statusTable = N(StatusTable), - .escapeChance = 50, - .airLiftChance = 100, - .hurricaneChance = 100, - .spookChance = 0, - .upAndAwayChance = 95, - .spinSmashReq = 0, - .powerBounceChance = 85, - .coinReward = 0, - .size = { 28, 22 }, - .healthBarOffset = { 0, 0 }, - .statusIconOffset = { -10, 20 }, - .statusTextOffset = { 10, 20 }, -}; - -s32 N(DefaultAnims)[] = { - STATUS_KEY_NORMAL, ANIM_BulletBill_Idle, - STATUS_KEY_STONE, ANIM_BulletBill_Still, - STATUS_KEY_STOP, ANIM_BulletBill_Still, - STATUS_KEY_PARALYZE, ANIM_BulletBill_Still, - STATUS_END, -}; - -EvtScript N(EVS_Init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) - EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_FiredFromBlaster, LVar0) - EVT_IF_FALSE(LVar0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar1, 16) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_BlasterID, LVar0) - EVT_CALL(GetActorPos, LVar0, LVar1, LVar2, LVar3) - EVT_CALL(GetStatusFlags, LVar0, LVar4) - EVT_IF_FLAG(LVar4, STATUS_FLAG_SHRINK) - EVT_SET(LVar5, -13) - EVT_SET(LVar6, 4) - EVT_ELSE - EVT_SET(LVar5, -33) - EVT_SET(LVar6, 11) - EVT_END_IF - EVT_ADD(LVar1, LVar5) - EVT_ADD(LVar2, LVar6) - EVT_CALL(SetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(CopyStatusEffects, LVar0, ACTOR_SELF) - EVT_CALL(CopyBuffs, LVar0, ACTOR_SELF) - EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) - EVT_CALL(GetActorPos, LVar0, LVar1, LVarB, LVarC) - EVT_SUB(LVar1, 90) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BulletBill_Tense) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BulletBill_Idle) - EVT_CALL(ForceHomePos, ACTOR_SELF, LVar1, LVar2, LVar3) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_END_IF - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Idle) = { - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_Explode) = { - EVT_EXEC_WAIT(N(EVS_MakeExplosionFX)) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_BurnHurt) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_HandleEvent) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_RETURN - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_RETURN - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_RETURN - EVT_CASE_EQ(EVENT_EXPLODE_TRIGGER) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_EXEC_WAIT(N(EVS_Explode)) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Tense) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_Tense) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_TakeTurn) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BulletBill_Fire) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(15) - EVT_CALL(UseBattleCamPresetImmediately, BTL_CAM_PRESET_19) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 2, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar3, LVar1) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_SET(LVar1, LVar3) - EVT_SUB(LVar0, 90) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(RemoveActor, ACTOR_SELF) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar3, LVar1) - EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) - EVT_SET(LVar1, LVar3) - EVT_ADD(LVar0, 10) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 12, FALSE, TRUE, FALSE) - EVT_EXEC_WAIT(N(EVS_MakeExplosionFX)) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, DMG_IMPACT, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, PRT_MAIN) - EVT_SET_CONST(LVar1, ANIM_BulletBill_BurnHurt) - EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_END -}; - -EvtScript N(EVS_MakeExplosionFX) = { - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar2, 2) - EVT_PLAY_EFFECT(EFFECT_SMOKE_RING, 0, LVar0, LVar1, LVar2, 0) - EVT_ADD(LVar1, 16) - EVT_ADD(LVar2, 2) - EVT_PLAY_EFFECT(EFFECT_BLAST, 0, LVar0, LVar1, LVar2, EVT_FLOAT(3.0), 30, 0) - EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2078) - EVT_CALL(StartRumble, 11) - EVT_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) - EVT_END_THREAD - EVT_RETURN - EVT_END -}; +#include "battle/common/actor/bullet_bill.inc.c" diff --git a/src/battle/area/trd_part_1/actor/koopa_troopa.c b/src/battle/area/trd_part_1/actor/koopa_troopa.c index 8bf2f01f88..2c15873fca 100644 --- a/src/battle/area/trd_part_1/actor/koopa_troopa.c +++ b/src/battle/area/trd_part_1/actor/koopa_troopa.c @@ -1,5 +1,3 @@ #include "../area.h" -//TODO migrate into include -#define NAMESPACE A(koopa_troopa) #include "battle/common/actor/koopa_troopa.inc.c" diff --git a/src/battle/area/trd_part_1/actor/paratroopa.c b/src/battle/area/trd_part_1/actor/paratroopa.c index 822160dafe..746d24e524 100644 --- a/src/battle/area/trd_part_1/actor/paratroopa.c +++ b/src/battle/area/trd_part_1/actor/paratroopa.c @@ -1,5 +1,3 @@ #include "../area.h" -//TODO migrate into include -#define NAMESPACE A(paratroopa) #include "battle/common/actor/paratroopa.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_00.c b/src/battle/area/trd_part_1/stage/trd_00.c index a3b6861b4e..70bb3b8547 100644 --- a/src/battle/area/trd_part_1/stage/trd_00.c +++ b/src/battle/area/trd_part_1/stage/trd_00.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_00.inc.c" +#include "battle/common/stage/area_trd/trd_00.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_01.c b/src/battle/area/trd_part_1/stage/trd_01.c index 522bdbfdbe..c366ba158e 100644 --- a/src/battle/area/trd_part_1/stage/trd_01.c +++ b/src/battle/area/trd_part_1/stage/trd_01.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_01.inc.c" +#include "battle/common/stage/area_trd/trd_01.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_02.c b/src/battle/area/trd_part_1/stage/trd_02.c index f6d69cee62..24ec04320b 100644 --- a/src/battle/area/trd_part_1/stage/trd_02.c +++ b/src/battle/area/trd_part_1/stage/trd_02.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_02.inc.c" +#include "battle/common/stage/area_trd/trd_02.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_02b.c b/src/battle/area/trd_part_1/stage/trd_02b.c index d1521096ba..476775b824 100644 --- a/src/battle/area/trd_part_1/stage/trd_02b.c +++ b/src/battle/area/trd_part_1/stage/trd_02b.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_02b.inc.c" +#include "battle/common/stage/area_trd/trd_02b.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_02c.c b/src/battle/area/trd_part_1/stage/trd_02c.c index 382d967d47..2978f9a5fe 100644 --- a/src/battle/area/trd_part_1/stage/trd_02c.c +++ b/src/battle/area/trd_part_1/stage/trd_02c.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_02c.inc.c" +#include "battle/common/stage/area_trd/trd_02c.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_02d.c b/src/battle/area/trd_part_1/stage/trd_02d.c index 63ae59d351..442c49b22d 100644 --- a/src/battle/area/trd_part_1/stage/trd_02d.c +++ b/src/battle/area/trd_part_1/stage/trd_02d.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_02d.inc.c" +#include "battle/common/stage/area_trd/trd_02d.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_03.c b/src/battle/area/trd_part_1/stage/trd_03.c index 792bf53cef..78673bb923 100644 --- a/src/battle/area/trd_part_1/stage/trd_03.c +++ b/src/battle/area/trd_part_1/stage/trd_03.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_03.inc.c" +#include "battle/common/stage/area_trd/trd_03.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_04.c b/src/battle/area/trd_part_1/stage/trd_04.c index c1c9ad7385..7a02e87175 100644 --- a/src/battle/area/trd_part_1/stage/trd_04.c +++ b/src/battle/area/trd_part_1/stage/trd_04.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_04.inc.c" +#include "battle/common/stage/area_trd/trd_04.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_05.c b/src/battle/area/trd_part_1/stage/trd_05.c index a83190d867..2780d17558 100644 --- a/src/battle/area/trd_part_1/stage/trd_05.c +++ b/src/battle/area/trd_part_1/stage/trd_05.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05.inc.c" +#include "battle/common/stage/area_trd/trd_05.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_05b.c b/src/battle/area/trd_part_1/stage/trd_05b.c index 89d5f278e2..a64df51d00 100644 --- a/src/battle/area/trd_part_1/stage/trd_05b.c +++ b/src/battle/area/trd_part_1/stage/trd_05b.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05b.inc.c" +#include "battle/common/stage/area_trd/trd_05b.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_05c.c b/src/battle/area/trd_part_1/stage/trd_05c.c index 842b9d1c6a..a96cd9951b 100644 --- a/src/battle/area/trd_part_1/stage/trd_05c.c +++ b/src/battle/area/trd_part_1/stage/trd_05c.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05c.inc.c" +#include "battle/common/stage/area_trd/trd_05c.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_05d.c b/src/battle/area/trd_part_1/stage/trd_05d.c index 0e93b2a6b7..d04b16cbed 100644 --- a/src/battle/area/trd_part_1/stage/trd_05d.c +++ b/src/battle/area/trd_part_1/stage/trd_05d.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05d.inc.c" +#include "battle/common/stage/area_trd/trd_05d.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_05e.c b/src/battle/area/trd_part_1/stage/trd_05e.c index 91721eab43..604187371d 100644 --- a/src/battle/area/trd_part_1/stage/trd_05e.c +++ b/src/battle/area/trd_part_1/stage/trd_05e.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05e.inc.c" +#include "battle/common/stage/area_trd/trd_05e.inc.c" diff --git a/src/battle/area/trd_part_1/stage/trd_05f.c b/src/battle/area/trd_part_1/stage/trd_05f.c index 648637d788..612276f479 100644 --- a/src/battle/area/trd_part_1/stage/trd_05f.c +++ b/src/battle/area/trd_part_1/stage/trd_05f.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05f.inc.c" +#include "battle/common/stage/area_trd/trd_05f.inc.c" diff --git a/src/battle/area/trd_part_2/area.c b/src/battle/area/trd_part_2/area.c index 1c5bb03e8a..56bfeab8fb 100644 --- a/src/battle/area/trd_part_2/area.c +++ b/src/battle/area/trd_part_2/area.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" #include "area.h" extern ActorBlueprint A(green_ninja_koopa); diff --git a/src/battle/area/trd_part_2/stage/trd_00.c b/src/battle/area/trd_part_2/stage/trd_00.c index a3b6861b4e..70bb3b8547 100644 --- a/src/battle/area/trd_part_2/stage/trd_00.c +++ b/src/battle/area/trd_part_2/stage/trd_00.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_00.inc.c" +#include "battle/common/stage/area_trd/trd_00.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_01.c b/src/battle/area/trd_part_2/stage/trd_01.c index 522bdbfdbe..c366ba158e 100644 --- a/src/battle/area/trd_part_2/stage/trd_01.c +++ b/src/battle/area/trd_part_2/stage/trd_01.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_01.inc.c" +#include "battle/common/stage/area_trd/trd_01.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_02.c b/src/battle/area/trd_part_2/stage/trd_02.c index f6d69cee62..24ec04320b 100644 --- a/src/battle/area/trd_part_2/stage/trd_02.c +++ b/src/battle/area/trd_part_2/stage/trd_02.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_02.inc.c" +#include "battle/common/stage/area_trd/trd_02.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_02b.c b/src/battle/area/trd_part_2/stage/trd_02b.c index d1521096ba..476775b824 100644 --- a/src/battle/area/trd_part_2/stage/trd_02b.c +++ b/src/battle/area/trd_part_2/stage/trd_02b.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_02b.inc.c" +#include "battle/common/stage/area_trd/trd_02b.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_03.c b/src/battle/area/trd_part_2/stage/trd_03.c index 792bf53cef..78673bb923 100644 --- a/src/battle/area/trd_part_2/stage/trd_03.c +++ b/src/battle/area/trd_part_2/stage/trd_03.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_03.inc.c" +#include "battle/common/stage/area_trd/trd_03.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_04.c b/src/battle/area/trd_part_2/stage/trd_04.c index c1c9ad7385..7a02e87175 100644 --- a/src/battle/area/trd_part_2/stage/trd_04.c +++ b/src/battle/area/trd_part_2/stage/trd_04.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_04.inc.c" +#include "battle/common/stage/area_trd/trd_04.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_05.c b/src/battle/area/trd_part_2/stage/trd_05.c index a83190d867..2780d17558 100644 --- a/src/battle/area/trd_part_2/stage/trd_05.c +++ b/src/battle/area/trd_part_2/stage/trd_05.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05.inc.c" +#include "battle/common/stage/area_trd/trd_05.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_05b.c b/src/battle/area/trd_part_2/stage/trd_05b.c index 89d5f278e2..a64df51d00 100644 --- a/src/battle/area/trd_part_2/stage/trd_05b.c +++ b/src/battle/area/trd_part_2/stage/trd_05b.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05b.inc.c" +#include "battle/common/stage/area_trd/trd_05b.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_05c.c b/src/battle/area/trd_part_2/stage/trd_05c.c index 842b9d1c6a..a96cd9951b 100644 --- a/src/battle/area/trd_part_2/stage/trd_05c.c +++ b/src/battle/area/trd_part_2/stage/trd_05c.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05c.inc.c" +#include "battle/common/stage/area_trd/trd_05c.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_05d.c b/src/battle/area/trd_part_2/stage/trd_05d.c index 0e93b2a6b7..d04b16cbed 100644 --- a/src/battle/area/trd_part_2/stage/trd_05d.c +++ b/src/battle/area/trd_part_2/stage/trd_05d.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05d.inc.c" +#include "battle/common/stage/area_trd/trd_05d.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_05e.c b/src/battle/area/trd_part_2/stage/trd_05e.c index 91721eab43..604187371d 100644 --- a/src/battle/area/trd_part_2/stage/trd_05e.c +++ b/src/battle/area/trd_part_2/stage/trd_05e.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05e.inc.c" +#include "battle/common/stage/area_trd/trd_05e.inc.c" diff --git a/src/battle/area/trd_part_2/stage/trd_05f.c b/src/battle/area/trd_part_2/stage/trd_05f.c index 648637d788..612276f479 100644 --- a/src/battle/area/trd_part_2/stage/trd_05f.c +++ b/src/battle/area/trd_part_2/stage/trd_05f.c @@ -1,3 +1,3 @@ #include "../area.h" -#include "battle/common/stage/trd_05f.inc.c" +#include "battle/common/stage/area_trd/trd_05f.inc.c" diff --git a/src/battle/area/trd_part_3/area.c b/src/battle/area/trd_part_3/area.c index e08a33f976..88e6e9990e 100644 --- a/src/battle/area/trd_part_3/area.c +++ b/src/battle/area/trd_part_3/area.c @@ -1,6 +1,3 @@ -#include "common.h" -#include "battle/battle.h" -#include "script_api/battle.h" #include "area.h" extern ActorBlueprint A(eldstar); diff --git a/src/battle/area/trd_part_3/stage/nok_01.c b/src/battle/area/trd_part_3/stage/nok_01.c index 22ce52c3e7..29cafe42c3 100644 --- a/src/battle/area/trd_part_3/stage/nok_01.c +++ b/src/battle/area/trd_part_3/stage/nok_01.c @@ -1,5 +1,3 @@ #include "../area.h" -//TODO migrate into include -#define NAMESPACE A(nok_01) -#include "battle/common/stage/nok_01.inc.c" +#include "battle/common/stage/area_nok/nok_01.inc.c" diff --git a/src/battle/battle.h b/src/battle/battle.h index 075799fbcc..01364762a9 100644 --- a/src/battle/battle.h +++ b/src/battle/battle.h @@ -259,8 +259,8 @@ typedef enum ActorType { ACTOR_TYPE_SIGNAL_GUY = 0xAC, ACTOR_TYPE_SHY_SQUAD_DUP = 0xAD, ACTOR_TYPE_SHY_GUY_DUP = 0xAE, - ACTOR_TYPE_ANTI_GUY = 0xAF, - ACTOR_TYPE_ANTI_GUY_DUP = 0xB0, + ACTOR_TYPE_ANTI_GUY_OMO = 0xAF, + ACTOR_TYPE_ANTI_GUY_KPA = 0xB0, ACTOR_TYPE_BIG_LANTERN_GHOST = 0xB1, ACTOR_TYPE_GOOMBA_KING_DUP = 0xB2, ACTOR_TYPE_LAVA_PIRANHA_PHASE_1 = 0xB3, diff --git a/src/battle/battle_tables.h b/src/battle/battle_tables.h index 5c1f14d8fe..5046f7c2a9 100644 --- a/src/battle/battle_tables.h +++ b/src/battle/battle_tables.h @@ -1,7 +1,6 @@ #ifndef _BATTLE_BATTLE_TABLE_H_ #define _BATTLE_BATTLE_TABLE_H_ -#include "common.h" #include "battle/battle.h" extern BattleList b_area_kmr_part_1_Formations; diff --git a/src/battle/common/actor/albino_dino.inc.c b/src/battle/common/actor/albino_dino.inc.c new file mode 100644 index 0000000000..94bb171aa7 --- /dev/null +++ b/src/battle/common/actor/albino_dino.inc.c @@ -0,0 +1,338 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/AlbinoDino.h" + +#define NAMESPACE A(albino_dino) + +extern EvtScript N(init); +extern EvtScript N(idle); +extern EvtScript N(takeTurn); +extern EvtScript N(handleEvent); + +API_CALLABLE(N(func_80218240_649050)) { // unused + Bytecode* args = script->ptrReadPos; + EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++); + f32 var1 = evt_get_variable(script, *args++); + f32 var2 = evt_get_variable(script, *args++); + f32 var3 = evt_get_variable(script, *args++); + + // function is never called, so the effect type can't be inferred + ((f32*)effect->data.any)[14] = var1; + ((f32*)effect->data.any)[15] = var2; + ((f32*)effect->data.any)[16] = var3; + + return ApiStatus_DONE2; +} + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_AlbinoDino_Idle, + STATUS_KEY_STONE, ANIM_AlbinoDino_Still, + STATUS_KEY_SLEEP, ANIM_AlbinoDino_Idle, + STATUS_KEY_POISON, ANIM_AlbinoDino_Idle, + STATUS_KEY_STOP, ANIM_AlbinoDino_Still, + STATUS_KEY_STATIC, ANIM_AlbinoDino_Idle, + STATUS_KEY_PARALYZE, ANIM_AlbinoDino_Still, + STATUS_KEY_DIZZY, ANIM_AlbinoDino_Still, + STATUS_KEY_FEAR, ANIM_AlbinoDino_Still, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 4, + ELEMENT_FIRE, 99, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 0, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 0, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 0, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 0, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -9, 46 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -6, -17 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_ALBINO_DINO, + .level = 23, + .maxHP = 8, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 40, + .airLiftChance = 15, + .hurricaneChance = 10, + .spookChance = 25, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 64, 56 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -22, 24 }, + .statusTextOffset = { 11, 40 }, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(returnHome) = { + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_AlbinoDino_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_AlbinoDino_Idle) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_BurntHurt) + EVT_SET_CONST(LVar2, ANIM_AlbinoDino_BurntStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_BurntHurt) + EVT_SET_CONST(LVar2, ANIM_AlbinoDino_BurntStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_BurntStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Run) + EVT_SET_CONST(LVar2, ANIM_AlbinoDino_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_AlbinoDino_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(stamp) = { + EVT_SET(LVarA, 0) + EVT_LABEL(0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetActorYaw, ACTOR_SELF, LVar3) + EVT_IF_EQ(LVar3, 0) + EVT_ADD(LVar0, 20) + EVT_ELSE + EVT_ADD(LVar0, -20) + EVT_END_IF + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 25, 8, 45, 20, 0) + EVT_IF_GT(LVarA, 3) + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 2, EVT_FLOAT(0.2)) + EVT_SET(LVarA, 0) + EVT_END_IF + EVT_ADD(LVarA, 1) + EVT_WAIT(2) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_EXEC_GET_TID(N(stamp), LVar9) + EVT_THREAD + EVT_LOOP(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_30B) + EVT_WAIT(4) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FD) + EVT_WAIT(4) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_AlbinoDino_Run) + EVT_WAIT(20) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarF, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVarF) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_THREAD + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, -100, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_KILL_THREAD(LVar9) + EVT_END_THREAD + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_WAIT(30) + EVT_IF_EQ(LVarF, HIT_RESULT_LUCKY) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(40) + EVT_CALL(YieldTurn) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) + EVT_CALL(AddGoalPos, ACTOR_SELF, 12, 0, 0) + EVT_ELSE + EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) + EVT_END_IF + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 4, EVT_FLOAT(1.5)) + EVT_END_THREAD + EVT_KILL_THREAD(LVar9) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + // invalid status field has 24% chance, but no status and doesn't have STATUS_FLAG_80000000 set + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, 0, 0, 24, 4, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVarF) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FD) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_AlbinoDino_Idle) + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 3, EVT_FLOAT(1.0)) + EVT_WAIT(10) + EVT_CALL(YieldTurn) + EVT_EXEC_WAIT(N(returnHome)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/amazy_dayzee.inc.c b/src/battle/common/actor/amazy_dayzee.inc.c new file mode 100644 index 0000000000..50906190b0 --- /dev/null +++ b/src/battle/common/actor/amazy_dayzee.inc.c @@ -0,0 +1,378 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Dayzee.h" + +#define NAMESPACE A(amazy_dayzee) + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); +extern s32 N(IdleAnimations)[]; + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 1, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 10, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 10, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 10, + STATUS_KEY_SHRINK, 10, + STATUS_KEY_STOP, 10, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, -1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, -2, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -2, 30 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -8 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_AMAZY_DAYZEE, + .level = 100, + .maxHP = 20, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 90, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 100, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 70, + .coinReward = 5, + .size = { 32, 34 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -14, 17 }, + .statusTextOffset = { 9, 25 }, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_Dayzee_Amazy_Anim01, + STATUS_KEY_STONE, ANIM_Dayzee_Amazy_Anim00, + STATUS_KEY_SLEEP, ANIM_Dayzee_Amazy_Anim0C, + STATUS_KEY_POISON, ANIM_Dayzee_Amazy_Anim01, + STATUS_KEY_STOP, ANIM_Dayzee_Amazy_Anim00, + STATUS_KEY_STATIC, ANIM_Dayzee_Amazy_Anim01, + STATUS_KEY_PARALYZE, ANIM_Dayzee_Amazy_Anim00, + STATUS_KEY_DIZZY, ANIM_Dayzee_Amazy_Anim0B, + STATUS_KEY_FEAR, ANIM_Dayzee_Amazy_Anim0B, + STATUS_END, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_LABEL(0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 15) + EVT_SUB(LVar2, 2) + EVT_PLAY_EFFECT(EFFECT_SPARKLES, 2, LVar0, LVar1, LVar2, 30, 0) + EVT_WAIT(15) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(returnHome) = { + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim09) + EVT_SET_CONST(LVar2, ANIM_Dayzee_Amazy_Anim0A) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim09) + EVT_SET_CONST(LVar2, ANIM_Dayzee_Amazy_Anim0A) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim0A) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim04) + EVT_SET_CONST(LVar2, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 1, 0) + EVT_ELSE + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 3, 0) + EVT_END_IF + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Amazy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(attackPainfulSong) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorPos, ACTOR_SELF, -20, LVar1, LVar2) + EVT_ELSE + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 70) + EVT_SET(LFlag0, FALSE) + EVT_LABEL(0) + EVT_IF_EQ(LFlag0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim0E) + EVT_SET(LFlag0, TRUE) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim0F) + EVT_SET(LFlag0, FALSE) + EVT_END_IF + EVT_WAIT(1) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_IF_GT(LVar0, 0) + EVT_GOTO(0) + EVT_END_IF + EVT_IF_EQ(LFlag0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim0E) + EVT_SET(LFlag0, TRUE) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim0F) + EVT_SET(LFlag0, FALSE) + EVT_END_IF + EVT_WAIT(1) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(SetGoalPos, ACTOR_SELF, -35, 0, 10) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim01) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim06) + EVT_WAIT(40) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim07) + EVT_END_THREAD + EVT_WAIT(20) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_DAYZEE_SONG) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 25) + EVT_ADD(LVar2, 2) + EVT_LOOP(13) + EVT_CALL(RandInt, 30, LVar3) + EVT_SUB(LVar3, 15) + EVT_ADD(LVar3, LVar0) + EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 1, LVar3, LVar1, LVar2, 0) + EVT_WAIT(10) + EVT_END_LOOP + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim01) + EVT_WAIT(10) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_WAIT(15) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, DAMAGE_TYPE_NO_CONTACT, 0, DMG_STATUS_KEY(STATUS_FLAG_SLEEP, 3, 15), 20, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVarF) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(2) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 10) + EVT_WAIT(20) + EVT_CALL(YieldTurn) + EVT_EXEC_WAIT(N(returnHome)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(flee) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) + EVT_CALL(SetBattleCamZoom, 300) + EVT_CALL(SetBattleCamOffsetZ, 30) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) + EVT_CALL(MoveBattleCamOver, 30) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim03) + EVT_WAIT(10) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_WAIT(20) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(EnableActorBlur, ACTOR_SELF, 1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Amazy_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) + EVT_ADD(LVar0, 200) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnableActorBlur, ACTOR_SELF, 0) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_BATTLE_FLED, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_CALL(RemoveActor, ACTOR_SELF) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_EXEC_WAIT(N(attackPainfulSong)) + EVT_RETURN + EVT_END_IF + EVT_CALL(RandInt, 1000, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_LT(850) + EVT_EXEC_WAIT(N(flee)) + EVT_CASE_DEFAULT + EVT_EXEC_WAIT(N(attackPainfulSong)) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/anti_guy.inc.c b/src/battle/common/actor/anti_guy.inc.c new file mode 100644 index 0000000000..fcdf4736b1 --- /dev/null +++ b/src/battle/common/actor/anti_guy.inc.c @@ -0,0 +1,508 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/ShyGuy.h" + +#define NAMESPACE A(anti_guy) + +extern s32 N(IdleAnimations_80221A14)[]; +extern EvtScript N(init_80221A60); +extern EvtScript N(takeTurn_802233AC); +extern EvtScript N(idle_80221AAC); +extern EvtScript N(handleEvent_80221C20); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable_80221910)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8022191C)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 50, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + #ifdef ANTIGUY_TRIO + STATUS_KEY_PARALYZE, 50, + #else + STATUS_KEY_PARALYZE, 60, + #endif + STATUS_KEY_SHRINK, 50, + STATUS_KEY_STOP, 50, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, -1, + STATUS_TURN_MOD_STOP, -2, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts_802219C8)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80221A14), + .defenseTable = N(DefenseTable_80221910), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + #ifdef ANTIGUY_TRIO + .type = ACTOR_TYPE_ANTI_GUY_KPA, + #else + .type = ACTOR_TYPE_ANTI_GUY_OMO, + #endif + .level = 42, + .maxHP = 50, + .partCount = ARRAY_COUNT( N(ActorParts_802219C8)), + .partsData = N(ActorParts_802219C8), + .initScript = &N(init_80221A60), + .statusTable = N(StatusTable_8022191C), + #ifdef ANTIGUY_TRIO + .escapeChance = 0, + #else + .escapeChance = 50, + #endif + .airLiftChance = 0, + .hurricaneChance = 0, + .spookChance = 0, + .upAndAwayChance = 0, + .spinSmashReq = 0, + .powerBounceChance = 75, + .coinReward = 0, + .size = { 30, 30 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_80221A14)[] = { + STATUS_KEY_NORMAL, ANIM_ShyGuy_Black_Anim01, + STATUS_KEY_STONE, ANIM_ShyGuy_Black_Anim00, + STATUS_KEY_SLEEP, ANIM_ShyGuy_Black_Anim12, + STATUS_KEY_POISON, ANIM_ShyGuy_Black_Anim01, + STATUS_KEY_STOP, ANIM_ShyGuy_Black_Anim00, + STATUS_KEY_STATIC, ANIM_ShyGuy_Black_Anim01, + STATUS_KEY_PARALYZE, ANIM_ShyGuy_Black_Anim00, + STATUS_KEY_DIZZY, ANIM_ShyGuy_Black_Anim13, + STATUS_KEY_FEAR, ANIM_ShyGuy_Black_Anim13, + STATUS_END, +}; + +EvtScript N(init_80221A60) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_802233AC))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80221AAC))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80221C20))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_80221AAC) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(80221BBC) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80221C20) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Black_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Black_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(80221BBC)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim03) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Black_Anim14) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(802220FC) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_WAIT(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_END_THREAD + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim05) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 10, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) + EVT_WAIT(8) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(80221BBC)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(80222824) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 80) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) + EVT_THREAD + EVT_WAIT(12) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) + EVT_THREAD + EVT_WAIT(9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 12, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) + EVT_SET(LVar3, 0) + EVT_LOOP(20) + EVT_SUB(LVar3, 30) + EVT_IF_LT(LVar3, 0) + EVT_ADD(LVar3, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim09) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim07) + EVT_WAIT(15) + EVT_GOTO(2) + EVT_LABEL(1) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim10) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 50) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim11) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim13) + EVT_END_IF + EVT_WAIT(25) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_LABEL(2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Black_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Black_Anim01) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_802233AC) = { + EVT_CALL(RandInt, 1, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_EXEC_WAIT(N(802220FC)) + EVT_ELSE + EVT_EXEC_WAIT(N(80222824)) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/bandit.inc.c b/src/battle/common/actor/bandit.inc.c index 7d0625370e..4bf10c015b 100644 --- a/src/battle/common/actor/bandit.inc.c +++ b/src/battle/common/actor/bandit.inc.c @@ -3,49 +3,60 @@ #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Bandit.h" -#include "sprite/npc/WorldParakarry.h" -extern EvtScript N(init); -extern EvtScript N(init_coin); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); +#define NAMESPACE A(bandit) + +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Init_Coin); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_TakeTurn); + +BSS s32 N(DropCoinScript)[1]; enum N(ActorPartIDs) { PRT_MAIN = 1, PRT_COIN = 2, }; -BSS s32 N(thread_dropCoin)[1]; +enum N(ActorVars) { + AVAR_HasCoin = 0, // has stolen coins + AVAR_NumCoins = 1, // number of coins stolen + AVAR_Coin_NumCoins = 1, // number of coins stolen also stored in coin actor +}; -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_Bandit_Anim01, - STATUS_KEY_STONE, ANIM_Bandit_Anim00, - STATUS_KEY_SLEEP, ANIM_Bandit_Anim10, - STATUS_KEY_POISON, ANIM_Bandit_Anim01, - STATUS_KEY_STOP, ANIM_Bandit_Anim00, - STATUS_KEY_STATIC, ANIM_Bandit_Anim01, - STATUS_KEY_PARALYZE, ANIM_Bandit_Anim00, - STATUS_KEY_DIZZY, ANIM_Bandit_Anim11, - STATUS_KEY_FEAR, ANIM_Bandit_Anim11, +enum N(ActorParams) { + DMG_TACKLE = 2, +}; + +s32 N(DefaultAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Bandit_Idle, + STATUS_KEY_STONE, ANIM_Bandit_Still, + STATUS_KEY_SLEEP, ANIM_Bandit_Sleep, + STATUS_KEY_POISON, ANIM_Bandit_Idle, + STATUS_KEY_STOP, ANIM_Bandit_Still, + STATUS_KEY_STATIC, ANIM_Bandit_Idle, + STATUS_KEY_PARALYZE, ANIM_Bandit_Still, + STATUS_KEY_DIZZY, ANIM_Bandit_Dizzy, + STATUS_KEY_FEAR, ANIM_Bandit_Dizzy, STATUS_END, }; -s32 N(IdleAnimations_holdCoin)[] = { - STATUS_KEY_NORMAL, ANIM_Bandit_Anim02, - STATUS_KEY_STONE, ANIM_Bandit_Anim04, - STATUS_KEY_SLEEP, ANIM_Bandit_Anim10, - STATUS_KEY_POISON, ANIM_Bandit_Anim02, - STATUS_KEY_STOP, ANIM_Bandit_Anim04, - STATUS_KEY_STATIC, ANIM_Bandit_Anim02, - STATUS_KEY_PARALYZE, ANIM_Bandit_Anim04, - STATUS_KEY_DIZZY, ANIM_Bandit_Anim11, - STATUS_KEY_FEAR, ANIM_Bandit_Anim11, +s32 N(HoldingAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Bandit_IdleHolding, + STATUS_KEY_STONE, ANIM_Bandit_StillHolding, + STATUS_KEY_SLEEP, ANIM_Bandit_Sleep, + STATUS_KEY_POISON, ANIM_Bandit_IdleHolding, + STATUS_KEY_STOP, ANIM_Bandit_StillHolding, + STATUS_KEY_STATIC, ANIM_Bandit_IdleHolding, + STATUS_KEY_PARALYZE, ANIM_Bandit_StillHolding, + STATUS_KEY_DIZZY, ANIM_Bandit_Dizzy, + STATUS_KEY_FEAR, ANIM_Bandit_Dizzy, STATUS_END, }; -s32 N(IdleAnimations_coin)[] = { - STATUS_KEY_NORMAL, ANIM_Bandit_Anim14, +s32 N(CoinAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Bandit_Coin, STATUS_END, }; @@ -86,7 +97,7 @@ ActorPartBlueprint N(ActorParts)[] = { .posOffset = { 0, 0, 0 }, .targetOffset = { -2, 28 }, .opacity = 255, - .idleAnimations = N(IdleAnimations), + .idleAnimations = N(DefaultAnims), .defenseTable = N(DefenseTable), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, @@ -98,7 +109,7 @@ ActorPartBlueprint N(ActorParts)[] = { .posOffset = { 0, 30, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_coin), + .idleAnimations = N(CoinAnims), .defenseTable = N(DefenseTable), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, @@ -106,14 +117,14 @@ ActorPartBlueprint N(ActorParts)[] = { }, }; -ActorPartBlueprint N(ActorParts_coin)[] = { +ActorPartBlueprint N(CoinParts)[] = { { .flags = ACTOR_PART_FLAG_NO_TARGET, .index = PRT_COIN, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_coin), + .idleAnimations = N(CoinAnims), .defenseTable = N(DefenseTable), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, @@ -128,7 +139,7 @@ ActorBlueprint NAMESPACE = { .maxHP = 5, .partCount = ARRAY_COUNT(N(ActorParts)), .partsData = N(ActorParts), - .initScript = &N(init), + .initScript = &N(EVS_Init), .statusTable = N(StatusTable), .escapeChance = 40, .airLiftChance = 90, @@ -149,9 +160,9 @@ ActorBlueprint N(coin) = { .type = ACTOR_TYPE_BANDIT, .level = 9, .maxHP = 5, - .partCount = ARRAY_COUNT(N(ActorParts_coin)), - .partsData = N(ActorParts_coin), - .initScript = &N(init_coin), + .partCount = ARRAY_COUNT(N(CoinParts)), + .partsData = N(CoinParts), + .initScript = &N(EVS_Init_Coin), .statusTable = N(StatusTable), .escapeChance = 40, .airLiftChance = 90, @@ -167,54 +178,55 @@ ActorBlueprint N(coin) = { .statusTextOffset = { 10, 25 }, }; -Vec3i N(coin_pos) = { NPC_DISPOSE_LOCATION }; +Vec3i N(CoinPos) = { NPC_DISPOSE_LOCATION }; -Formation N(formation_coin) = { - ACTOR_BY_POS(N(coin), N(coin_pos), 0), +Formation N(CoinFormation) = { + ACTOR_BY_POS(N(coin), N(CoinPos), 0), }; -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HasCoin, 0) EVT_RETURN EVT_END }; -EvtScript N(dummy) = { +EvtScript N(EVS_Dummy) = { EVT_RETURN EVT_END }; -EvtScript N(init_coin) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(dummy))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(dummy))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(dummy))) +EvtScript N(EVS_Init_Coin) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_Dummy))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Dummy))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_Dummy))) EVT_RETURN EVT_END }; -EvtScript N(idle) = { +EvtScript N(EVS_Idle) = { EVT_RETURN EVT_END }; -EvtScript N(dropCoin) = { - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) +EvtScript N(EVS_DropCoin) = { + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_HasCoin, LVar0) EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_CASE_EQ(FALSE) + // do nothing + EVT_CASE_EQ(TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HasCoin, FALSE) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_COIN, ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_coin)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(CoinFormation)), FALSE) EVT_SET(LVarA, LVar0) EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_COIN, LVar1, LVar2, LVar3) EVT_CALL(SetActorPos, LVarA, LVar1, LVar2, LVar3) EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_COIN, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) - EVT_CALL(SetActorVar, LVarA, 1, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_NumCoins, LVar0) + EVT_CALL(SetActorVar, LVarA, AVAR_Coin_NumCoins, LVar0) EVT_CALL(SetActorJumpGravity, LVarA, EVT_FLOAT(1.0)) EVT_CALL(RandInt, 360, LVar0) EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) @@ -291,7 +303,7 @@ EvtScript N(dropCoin) = { EVT_CALL(GetGoalPos, LVarA, LVar0, LVar1, LVar2) EVT_PLAY_EFFECT(EFFECT_SMALL_GOLD_SPARKLE, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 0, 0) EVT_CALL(PlaySoundAtActor, LVarA, SOUND_211) - EVT_CALL(GetActorVar, LVarA, 1, LVar0) + EVT_CALL(GetActorVar, LVarA, AVAR_Coin_NumCoins, LVar0) EVT_CALL(AddCoin, LVar0) EVT_CALL(RemoveActor, LVarA) EVT_END_SWITCH @@ -299,17 +311,16 @@ EvtScript N(dropCoin) = { EVT_END }; - -EvtScript N(handleEvent) = { - EVT_USE_ARRAY(EVT_PTR(N(thread_dropCoin))) +EvtScript N(EVS_HandleEvent) = { + EVT_USE_ARRAY(EVT_PTR(N(DropCoinScript))) EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_EXEC_GET_TID(N(dropCoin), ArrayVar(0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_EXEC_GET_TID(N(EVS_DropCoin), ArrayVar(0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_LOOP(0) EVT_IS_THREAD_RUNNING(ArrayVar(0), LVar0) @@ -320,9 +331,9 @@ EvtScript N(handleEvent) = { EVT_END_LOOP EVT_CASE_OR_EQ(EVENT_HIT) EVT_CASE_OR_EQ(EVENT_SPIN_SMASH_LAUNCH_HIT) - EVT_EXEC_GET_TID(N(dropCoin), ArrayVar(0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_EXEC_GET_TID(N(EVS_DropCoin), ArrayVar(0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_LOOP(0) EVT_IS_THREAD_RUNNING(ArrayVar(0), LVar0) @@ -333,10 +344,10 @@ EvtScript N(handleEvent) = { EVT_END_LOOP EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_EXEC_GET_TID(N(dropCoin), ArrayVar(0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim0A) - EVT_SET_CONST(LVar2, ANIM_Bandit_Anim0B) + EVT_EXEC_GET_TID(N(EVS_DropCoin), ArrayVar(0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Bandit_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_LOOP(0) EVT_IS_THREAD_RUNNING(ArrayVar(0), LVar0) @@ -346,13 +357,13 @@ EvtScript N(handleEvent) = { EVT_WAIT(1) EVT_END_LOOP EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_EXEC_GET_TID(N(dropCoin), ArrayVar(0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim0A) - EVT_SET_CONST(LVar2, ANIM_Bandit_Anim0B) + EVT_EXEC_GET_TID(N(EVS_DropCoin), ArrayVar(0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Bandit_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim0B) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_LOOP(0) EVT_IS_THREAD_RUNNING(ArrayVar(0), LVar0) @@ -363,9 +374,9 @@ EvtScript N(handleEvent) = { EVT_END_LOOP EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_EXEC_GET_TID(N(dropCoin), ArrayVar(0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_EXEC_GET_TID(N(EVS_DropCoin), ArrayVar(0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_LOOP(0) EVT_IS_THREAD_RUNNING(ArrayVar(0), LVar0) @@ -375,12 +386,12 @@ EvtScript N(handleEvent) = { EVT_WAIT(1) EVT_END_LOOP EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_EXEC_GET_TID(N(dropCoin), ArrayVar(0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_EXEC_GET_TID(N(EVS_DropCoin), ArrayVar(0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_LOOP(0) EVT_IS_THREAD_RUNNING(ArrayVar(0), LVar0) @@ -391,47 +402,47 @@ EvtScript N(handleEvent) = { EVT_END_LOOP EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim07) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_HasCoin, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim01) + EVT_SET_CONST(LVar1, ANIM_Bandit_Idle) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim02) + EVT_SET_CONST(LVar1, ANIM_Bandit_IdleHolding) EVT_END_SWITCH - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_OR_EQ(EVENT_DEATH) EVT_CASE_OR_EQ(EVENT_SPIN_SMASH_LAUNCH_DEATH) - EVT_EXEC_GET_TID(N(dropCoin), ArrayVar(0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_EXEC_GET_TID(N(EVS_DropCoin), ArrayVar(0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_LOOP(0) EVT_IS_THREAD_RUNNING(ArrayVar(0), LVar0) @@ -443,14 +454,14 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim01) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_EXEC_GET_TID(N(dropCoin), ArrayVar(0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim07) - EVT_SET_CONST(LVar2, ANIM_Bandit_Anim09) + EVT_EXEC_GET_TID(N(EVS_DropCoin), ArrayVar(0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Run) + EVT_SET_CONST(LVar2, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_LOOP(0) EVT_IS_THREAD_RUNNING(ArrayVar(0), LVar0) @@ -461,9 +472,9 @@ EvtScript N(handleEvent) = { EVT_END_LOOP EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_EXEC_GET_TID(N(dropCoin), ArrayVar(0)) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) + EVT_EXEC_GET_TID(N(EVS_DropCoin), ArrayVar(0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_LOOP(0) EVT_IS_THREAD_RUNNING(ArrayVar(0), LVar0) @@ -473,28 +484,29 @@ EvtScript N(handleEvent) = { EVT_WAIT(1) EVT_END_LOOP EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Bandit_Anim09) - EVT_SET_CONST(LVar2, ANIM_WorldParakarry_Still) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bandit_Hurt) + EVT_SET_CONST(LVar2, STATUS_FLAG_DIZZY) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN EVT_CASE_DEFAULT EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim01) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Idle) EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_RETURN EVT_END }; -EvtScript N(takeTurn) = { +EvtScript N(EVS_TakeTurn) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + // if carrying a coin, run away + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_HasCoin, LVar0) EVT_IF_EQ(LVar0, 1) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim08) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_RunHolding) EVT_WAIT(30) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(10.0)) EVT_CALL(SetGoalPos, ACTOR_SELF, 300, 0, 0) @@ -515,16 +527,16 @@ EvtScript N(takeTurn) = { EVT_SET(LVar1, 0) EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_ELSE - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim07) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Run) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim01) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Idle) EVT_WAIT(6) EVT_END_IF EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim05) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Walk) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(AddGoalPos, ACTOR_SELF, 35, 0, 0) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) @@ -535,7 +547,7 @@ EvtScript N(takeTurn) = { EVT_CASE_OR_EQ(HIT_RESULT_MISS) EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) EVT_SET(LVarA, LVar0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim0D) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Tackle) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) @@ -558,11 +570,11 @@ EvtScript N(takeTurn) = { EVT_CALL(YieldTurn) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim07) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Run) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim01) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Idle) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) EVT_CALL(SetActorYaw, ACTOR_SELF, 0) EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) @@ -570,16 +582,17 @@ EvtScript N(takeTurn) = { EVT_RETURN EVT_END_CASE_GROUP EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim0D) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Tackle) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_TACKLE, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_HIT) EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + // dont steal coins if no damage, blocked EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) EVT_IF_LE(LVar0, 0) EVT_SET(LVar0, 1) @@ -590,58 +603,65 @@ EvtScript N(takeTurn) = { EVT_SET(LVar0, 1) EVT_GOTO(10) EVT_END_IF + // cant steal coins if shrunk EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) EVT_SET(LVar0, 0) EVT_GOTO(10) EVT_END_IF + // cant steal coins if player is stone EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_STONE) EVT_SET(LVar0, 0) EVT_GOTO(10) EVT_END_IF EVT_CALL(AddCoin, 0) + // choose outcome based on stolen coin count EVT_SWITCH(LVar0) EVT_CASE_EQ(0) EVT_SET(LVar0, 1) EVT_CASE_LT(10) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_NumCoins, LVar0) EVT_SET(LVar0, 2) EVT_CASE_GE(10) - EVT_CALL(SetActorVar, ACTOR_SELF, 1, 10) + // cap num stolen to 10 + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_NumCoins, 10) EVT_SET(LVar0, 2) EVT_END_SWITCH EVT_LABEL(10) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) + // couldn't steal (from shrunk or player stone) EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_ADD(LVar0, 30) EVT_SET(LVar1, 0) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim01) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Idle) EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim07) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Run) EVT_CASE_EQ(1) + // failed to steal (player blocked or damage negated) EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_ADD(LVar0, 30) EVT_SET(LVar1, 0) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim0E) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_LookUp) EVT_WAIT(20) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Sleep) EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim07) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Run) EVT_CASE_DEFAULT + // stole coins EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(GetGoalPos, ACTOR_SELF, LVarA, LVarB, LVarC) EVT_ADD(LVarA, 30) EVT_SET(LVarB, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_NumCoins, LVar0) EVT_MUL(LVar0, -1) EVT_CALL(AddCoin, LVar0) EVT_THREAD @@ -655,7 +675,7 @@ EvtScript N(takeTurn) = { EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_COIN, ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) EVT_END_THREAD EVT_THREAD - EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_NumCoins, LVar0) EVT_LOOP(LVar0) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_212) EVT_WAIT(1) @@ -664,13 +684,13 @@ EvtScript N(takeTurn) = { EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) EVT_CALL(SetGoalPos, ACTOR_SELF, LVarA, LVarB, LVarC) EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_holdCoin))) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim0E) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(HoldingAnims))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_LookUp) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HasCoin, 1) EVT_WAIT(7) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim0F) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_GotCoin) EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_Anim08) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bandit_RunHolding) EVT_END_SWITCH EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(YieldTurn) diff --git a/src/battle/common/actor/bill_blaster.inc.c b/src/battle/common/actor/bill_blaster.inc.c new file mode 100644 index 0000000000..7b112e406e --- /dev/null +++ b/src/battle/common/actor/bill_blaster.inc.c @@ -0,0 +1,254 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/BillBlaster.h" + +#define NAMESPACE A(bill_blaster) + +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_Move_FireBullet); +extern EvtScript N(EVS_Move_CheckForBullet); +extern s32 N(DefaultAnims)[]; + +extern ActorBlueprint A(bullet_bill); +extern Formation N(BulletBillSummon); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_TARGET = 2, +}; + +enum N(ActorVars) { + AVAR_BulletID = 0, + AVAR_HasBullet = 8, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 1, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 0, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 0, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 0, + STATUS_KEY_SHRINK, 50, + STATUS_KEY_STOP, 0, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -6, 29 }, + .opacity = 255, + .idleAnimations = N(DefaultAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -9 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_MULTI_TARGET | ACTOR_PART_FLAG_80000000, + .index = PRT_TARGET, + .posOffset = { 100, 0, 0 }, + .targetOffset = { -106, 29 }, + .opacity = 255, + .idleAnimations = N(DefaultAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -9 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_BILL_BLASTER, + .level = 10, + .maxHP = 4, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), + .escapeChance = 0, + .airLiftChance = 20, + .hurricaneChance = 15, + .spookChance = 0, + .upAndAwayChance = 95, + .spinSmashReq = 4, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 55, 32 }, + .healthBarOffset = { 8, 0 }, + .statusIconOffset = { -24, 20 }, + .statusTextOffset = { 5, 25 }, +}; + +s32 N(DefaultAnims)[] = { + STATUS_KEY_NORMAL, ANIM_BillBlaster_Idle, + STATUS_KEY_STONE, ANIM_BillBlaster_Still, + STATUS_KEY_STOP, ANIM_BillBlaster_Still, + STATUS_KEY_PARALYZE, ANIM_BillBlaster_Still, + STATUS_END, +}; + +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HasBullet, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Idle) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_HandleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BillBlaster_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_TakeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_HasBullet, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_EXEC_WAIT(N(EVS_Move_FireBullet)) + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(EVS_Move_CheckForBullet)) + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +API_CALLABLE(N(SetBulletInitVars)) { + N(BulletBillSummon)[0].var0 = TRUE; + N(BulletBillSummon)[0].var1 = script->owner1.actorID; + + return ApiStatus_DONE2; +} + +EvtScript N(EVS_Move_FireBullet) = { + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BillBlaster_Fire) + EVT_WAIT(13) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 10, EVT_FLOAT(1.0)) + EVT_END_THREAD + EVT_CALL(StartRumble, 9) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2C8) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 33) + EVT_ADD(LVar1, 19) + EVT_ADD(LVar2, 3) + EVT_PLAY_EFFECT(EFFECT_00, LVar0, LVar1, LVar2, 2, 5, 0, 2, 0) + EVT_PLAY_EFFECT(EFFECT_00, LVar0, LVar1, LVar2, 2, 5, 2, 2, 0) + EVT_WAIT(2) + EVT_CALL(N(SetBulletInitVars)) + EVT_CALL(SummonEnemy, EVT_PTR(N(BulletBillSummon)), FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_BulletID, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HasBullet, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Move_CheckForBullet) = { + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_BulletID, LVar0) + EVT_CALL(ActorExists, LVar0, LVar1) + EVT_IF_EQ(LVar1, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HasBullet, FALSE) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +Vec3i N(DefaultPos) = { NPC_DISPOSE_LOCATION }; + +Formation N(BulletBillSummon) = { + ACTOR_BY_POS(A(bullet_bill), N(DefaultPos), 100), +}; diff --git a/src/battle/common/actor/blue_shy_guy.inc.c b/src/battle/common/actor/blue_shy_guy.inc.c new file mode 100644 index 0000000000..17681c717c --- /dev/null +++ b/src/battle/common/actor/blue_shy_guy.inc.c @@ -0,0 +1,497 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/ShyGuy.h" + +#define NAMESPACE A(blue_shy_guy) + +extern s32 N(IdleAnimations_8021AE1C)[]; +extern EvtScript N(init_8021AE68); +extern EvtScript N(takeTurn_8021C7B4); +extern EvtScript N(idle_8021AEB4); +extern EvtScript N(handleEvent_8021B028); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable_8021AD10)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_SHOCK, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8021AD24)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021AE1C), + .defenseTable = N(DefenseTable_8021AD10), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_SHY_GUY, + .level = 14, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021AE68), + .statusTable = N(StatusTable_8021AD24), + .escapeChance = 60, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 80, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 28, 24 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_8021AE1C)[] = { + STATUS_KEY_NORMAL, ANIM_ShyGuy_Blue_Anim01, + STATUS_KEY_STONE, ANIM_ShyGuy_Blue_Anim00, + STATUS_KEY_SLEEP, ANIM_ShyGuy_Blue_Anim12, + STATUS_KEY_POISON, ANIM_ShyGuy_Blue_Anim01, + STATUS_KEY_STOP, ANIM_ShyGuy_Blue_Anim00, + STATUS_KEY_STATIC, ANIM_ShyGuy_Blue_Anim01, + STATUS_KEY_PARALYZE, ANIM_ShyGuy_Blue_Anim00, + STATUS_KEY_DIZZY, ANIM_ShyGuy_Blue_Anim13, + STATUS_KEY_FEAR, ANIM_ShyGuy_Blue_Anim13, + STATUS_END, +}; + +EvtScript N(init_8021AE68) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021C7B4))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021AEB4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021B028))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_8021AEB4) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021AFC4) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021B028) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Blue_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Blue_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8021AFC4)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim03) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Blue_Anim14) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021B504) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_WAIT(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_END_THREAD + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim05) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) + EVT_WAIT(8) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(8021AFC4)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021BC2C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim09) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 80) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim09) + EVT_THREAD + EVT_WAIT(12) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim09) + EVT_THREAD + EVT_WAIT(9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) + EVT_SET(LVar3, 0) + EVT_LOOP(20) + EVT_SUB(LVar3, 30) + EVT_IF_LT(LVar3, 0) + EVT_ADD(LVar3, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim09) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim07) + EVT_WAIT(15) + EVT_GOTO(2) + EVT_LABEL(1) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim10) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 50) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim11) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim13) + EVT_END_IF + EVT_WAIT(25) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_LABEL(2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Blue_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Blue_Anim01) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021C7B4) = { + EVT_CALL(RandInt, 1, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_EXEC_WAIT(N(8021B504)) + EVT_ELSE + EVT_EXEC_WAIT(N(8021BC2C)) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/bob_omb.inc.c b/src/battle/common/actor/bob_omb.inc.c new file mode 100644 index 0000000000..a9e5d00f25 --- /dev/null +++ b/src/battle/common/actor/bob_omb.inc.c @@ -0,0 +1,702 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Bobomb.h" + +#define NAMESPACE A(bob_omb) + +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_HandleEvent_Ignited); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +enum N(ActorVars) { + AVAR_HitDuringCombo = 0, + AVAR_Ignited = 8, +}; + +enum N(ActorParams) { + DMG_TACKLE = 1, + DMG_EXPLOSION = 2, +}; + +s32 N(DefaultAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Bobomb_Idle, + STATUS_KEY_STONE, ANIM_Bobomb_Still, + STATUS_KEY_SLEEP, ANIM_Bobomb_Sleep, + STATUS_KEY_POISON, ANIM_Bobomb_Walk, + STATUS_KEY_STOP, ANIM_Bobomb_Still, + STATUS_KEY_STATIC, ANIM_Bobomb_Idle, + STATUS_KEY_PARALYZE, ANIM_Bobomb_Still, + STATUS_KEY_DIZZY, ANIM_Bobomb_Dizzy, + STATUS_KEY_FEAR, ANIM_Bobomb_Dizzy, + STATUS_END, +}; + +s32 N(IgnitedAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Bobomb_WalkLit, + STATUS_KEY_STONE, ANIM_Bobomb_StillLit, + STATUS_KEY_SLEEP, ANIM_Bobomb_Sleep, + STATUS_KEY_POISON, ANIM_Bobomb_WalkLit, + STATUS_KEY_STOP, ANIM_Bobomb_StillLit, + STATUS_KEY_STATIC, ANIM_Bobomb_IdleLit, + STATUS_KEY_PARALYZE, ANIM_Bobomb_StillLit, + STATUS_KEY_DIZZY, ANIM_Bobomb_DizzyLit, + STATUS_KEY_FEAR, ANIM_Bobomb_DizzyLit, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 75, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 80, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 80, + STATUS_KEY_SHRINK, 90, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +s32 N(StatusTable_Ignited)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 0, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 40, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 40, + STATUS_KEY_SHRINK, 0, + STATUS_KEY_STOP, 0, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(DefaultAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -9 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_BOB_OMB, + .level = 6, + .maxHP = 3, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), + .escapeChance = 70, + .airLiftChance = 90, + .hurricaneChance = 90, + .spookChance = 90, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 34, 35 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Ignited, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HitDuringCombo, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Idle) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Ignite) = { + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_RETURN + EVT_END_IF + EVT_LABEL(0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Ignited, TRUE) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IgnitedAnims))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent_Ignited))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_CONTACT, TRUE) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_Ignited))) + EVT_CALL(PlayLoopingSoundAtActor, ACTOR_SELF, 0, SOUND_80000001) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_WalkLit) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, 0, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(func_8026ED20, ACTOR_SELF, PRT_MAIN, 1) + EVT_CALL(SetActorPaletteSwapParams, ACTOR_SELF, PRT_MAIN, SPR_PAL_Bobomb, SPR_PAL_Bobomb_Burst, 0, 10, 0, 10, 0, 0) + EVT_CALL(SetActorPaletteEffect, ACTOR_SELF, PRT_MAIN, PAL_ADJUST_BLEND_PALETTES_VARYING_INTERVALS) + EVT_WAIT(3) + EVT_CALL(StopLoopingSoundAtActor, ACTOR_SELF, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Defuse) = { + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Ignited, FALSE) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_CONTACT, FALSE) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable))) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar2, 2) + EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 3, LVar0, LVar1, LVar2, 0, 0) + EVT_CALL(StopLoopingSoundAtActor, ACTOR_SELF, 0) + EVT_CALL(func_8026ED20, ACTOR_SELF, PRT_MAIN, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Cleanup) = { + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Ignited, LVar0) + EVT_IF_EQ(LVar0, TRUE) + EVT_CALL(StopLoopingSoundAtActor, ACTOR_SELF, 0) + EVT_CALL(func_8026ED20, ACTOR_SELF, PRT_MAIN, 0) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Explode) = { + EVT_EXEC_WAIT(N(EVS_Cleanup)) + EVT_CALL(StartRumble, 11) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 2, EVT_FLOAT(0.75)) + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(3.0)) + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 10, EVT_FLOAT(4.5)) + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(3.0)) + EVT_END_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar2, 2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_RING, 0, LVar0, LVar1, LVar2, 0) + EVT_ADD(LVar1, 20) + EVT_ADD(LVar2, 2) + EVT_PLAY_EFFECT(EFFECT_EXPLOSION, 0, LVar0, LVar1, LVar2, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BOMB_BLAST) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_HandleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(EVENT_HIT_COMBO) + EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) + EVT_IF_NE(LVar0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_HitDuringCombo, TRUE) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CASE_EQ(EVENT_HIT) + EVT_CALL(GetLastElement, LVarE) + EVT_IF_FLAG(LVarE, DAMAGE_TYPE_SHOCK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Bobomb_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) + EVT_IF_NE(LVar0, 0) + EVT_EXEC_WAIT(N(EVS_Ignite)) + EVT_END_IF + EVT_END_IF + EVT_CASE_OR_EQ(EVENT_BURN_HIT) + EVT_CASE_OR_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Bobomb_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) + EVT_IF_NE(LVar0, 0) + EVT_EXEC_WAIT(N(EVS_Ignite)) + EVT_END_IF + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_EXEC_WAIT(N(EVS_Cleanup)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_SHOCK_HIT) + EVT_CASE_OR_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_ZERO_DAMAGE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_HitDuringCombo, LVar0) + EVT_IF_EQ(LVar0, TRUE) + EVT_EXEC_WAIT(N(EVS_Ignite)) + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_CALL(GetLastElement, LVarE) + EVT_IF_FLAG(LVarE, DAMAGE_TYPE_SHOCK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Bobomb_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_EXEC_WAIT(N(EVS_Cleanup)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_EXPLODE_TRIGGER) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Bobomb_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Run) + EVT_SET_CONST(LVar2, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Dizzy) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Dizzy) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_HandleEvent_Ignited) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(EVENT_HIT_COMBO) + EVT_CALL(GetLastElement, LVarE) + EVT_IF_FLAG(LVarE, DAMAGE_TYPE_WATER) + EVT_EXEC_WAIT(N(EVS_Defuse)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_HurtLit) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_IF + EVT_CASE_EQ(EVENT_HIT) + EVT_CALL(GetLastElement, LVarE) + EVT_SWITCH(LVarE) + EVT_CASE_FLAG(DAMAGE_TYPE_WATER) + EVT_EXEC_WAIT(N(EVS_Defuse)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CASE_FLAG(DAMAGE_TYPE_SHOCK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnHurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_HurtLit) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) + EVT_IF_GT(LVar0, 0) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_END_IF + EVT_END_SWITCH + EVT_CASE_OR_EQ(EVENT_BURN_HIT) + EVT_CASE_OR_EQ(EVENT_BURN_DEATH) + EVT_CASE_OR_EQ(EVENT_SPIN_SMASH_HIT) + EVT_CASE_OR_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_CASE_OR_EQ(EVENT_EXPLODE_TRIGGER) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_IdleLit) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_CALL(GetLastElement, LVarE) + EVT_IF_FLAG(LVarE, DAMAGE_TYPE_WATER) + EVT_EXEC_WAIT(N(EVS_Defuse)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Hurt) + EVT_ELSE + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_SHOCK_HIT) + EVT_CASE_OR_EQ(EVENT_SHOCK_DEATH) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_IdleLit) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_EXEC_WAIT(N(EVS_Cleanup)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Run) + EVT_SET_CONST(LVar2, ANIM_Bobomb_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_DizzyLit) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_CALL(GetDamageSource, LVar0) + EVT_IF_EQ(LVar0, DMG_SRC_HURRICANE) + EVT_EXEC_WAIT(N(EVS_Defuse)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_Dizzy) + EVT_ELSE + EVT_CHILD_THREAD + EVT_WAIT(100) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_END_CHILD_THREAD + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_DizzyLit) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_UP_AND_AWAY) + EVT_EXEC_WAIT(N(EVS_Defuse)) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Attack_Tackle) = { + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Idle) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Run) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Dizzy) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 15) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_WAIT(8) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Idle) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_EQ(HIT_RESULT_HIT_STATIC) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Buildup) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) + EVT_PLAY_EFFECT(EFFECT_FLASHING_BOX_SHOCKWAVE, 0, LVar0, LVar1, LVar2, LVar4, LVar3, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_SHOCK) + EVT_WAIT(20) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_BLAST, 0, 0, DMG_EXPLOSION, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_RETURN + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_TACKLE, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Idle) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_WAIT(4) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Idle) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Attack_Blast) = { + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlayLoopingSoundAtActor, ACTOR_SELF, 0, SOUND_80000001) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_RunLit) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 80, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, -1, 14, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 90) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_RunLit) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_BurnStill) + EVT_WAIT(10) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, -1) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_RunLit) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 10, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_Buildup) + EVT_WAIT(15) + EVT_SET(LVarA, 1) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Bobomb_BurnStill) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_BLAST | DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_EXPLOSION, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_WAIT(15) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Bobomb_BurnStill) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_TakeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Ignited, LVar0) + EVT_IF_FALSE(LVar0) + EVT_EXEC_WAIT(N(EVS_Attack_Tackle)) + EVT_ELSE + EVT_EXEC_WAIT(N(EVS_Attack_Blast)) + EVT_RETURN + EVT_END_IF + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/bony_beetle.inc.c b/src/battle/common/actor/bony_beetle.inc.c new file mode 100644 index 0000000000..5168a81f15 --- /dev/null +++ b/src/battle/common/actor/bony_beetle.inc.c @@ -0,0 +1,1161 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/BonyBeetle.h" +#include "effects.h" + +#define NAMESPACE A(bony_beetle) + +extern EvtScript N(init); +extern EvtScript N(idle); +extern EvtScript N(takeTurn); +extern EvtScript N(handleEvent); +extern EvtScript N(handleEvent_normal); +extern EvtScript N(handleEvent_spiky); +extern EvtScript N(handleEvent_flipped); +extern EvtScript N(handleEvent_spiky_flipped); +extern EvtScript N(changeSpikesState); +extern EvtScript N(attackShellToss); +extern EvtScript N(attackSpikeBounce); +extern EvtScript N(standUp); +extern EvtScript N(standUp_spiky); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +enum N(ActorVars) { + N(VAR_WAS_HIT) = 1, + N(VAR_STATE) = 8, + N(VAR_FLIP_TRIGGERED) = 9, +}; + +enum N(States) { + N(STATE_NORMAL) = 0, + N(STATE_SPIKY) = 1, + N(STATE_FLIPPED) = 2, + N(STATE_SPIKY_FLIPPED) = 3, +}; + +s32 N(IdleAnimations_normal)[] = { + STATUS_KEY_NORMAL, ANIM_BonyBeetle_Anim04, + STATUS_KEY_STONE, ANIM_BonyBeetle_Anim00, + STATUS_KEY_SLEEP, ANIM_BonyBeetle_Anim2A, + STATUS_KEY_POISON, ANIM_BonyBeetle_Anim04, + STATUS_KEY_STOP, ANIM_BonyBeetle_Anim00, + STATUS_KEY_STATIC, ANIM_BonyBeetle_Anim04, + STATUS_KEY_PARALYZE, ANIM_BonyBeetle_Anim00, + STATUS_KEY_DIZZY, ANIM_BonyBeetle_Anim26, + STATUS_KEY_FEAR, ANIM_BonyBeetle_Anim26, + STATUS_END, +}; + +s32 N(IdleAnimations_spiky)[] = { + STATUS_KEY_NORMAL, ANIM_BonyBeetle_Anim05, + STATUS_KEY_STONE, ANIM_BonyBeetle_Anim01, + STATUS_KEY_SLEEP, ANIM_BonyBeetle_Anim2B, + STATUS_KEY_POISON, ANIM_BonyBeetle_Anim05, + STATUS_KEY_STOP, ANIM_BonyBeetle_Anim01, + STATUS_KEY_STATIC, ANIM_BonyBeetle_Anim05, + STATUS_KEY_PARALYZE, ANIM_BonyBeetle_Anim01, + STATUS_KEY_DIZZY, ANIM_BonyBeetle_Anim27, + STATUS_KEY_FEAR, ANIM_BonyBeetle_Anim27, + STATUS_END, +}; + +s32 N(IdleAnimations_flipped)[] = { + STATUS_KEY_NORMAL, ANIM_BonyBeetle_Anim06, + STATUS_KEY_STONE, ANIM_BonyBeetle_Anim02, + STATUS_KEY_SLEEP, ANIM_BonyBeetle_Anim2C, + STATUS_KEY_POISON, ANIM_BonyBeetle_Anim06, + STATUS_KEY_STOP, ANIM_BonyBeetle_Anim02, + STATUS_KEY_STATIC, ANIM_BonyBeetle_Anim06, + STATUS_KEY_PARALYZE, ANIM_BonyBeetle_Anim02, + STATUS_KEY_DIZZY, ANIM_BonyBeetle_Anim28, + STATUS_KEY_FEAR, ANIM_BonyBeetle_Anim28, + STATUS_END, +}; + +s32 N(IdleAnimations_spiky_flipped)[] = { + STATUS_KEY_NORMAL, ANIM_BonyBeetle_Anim07, + STATUS_KEY_STONE, ANIM_BonyBeetle_Anim03, + STATUS_KEY_SLEEP, ANIM_BonyBeetle_Anim2D, + STATUS_KEY_POISON, ANIM_BonyBeetle_Anim07, + STATUS_KEY_STOP, ANIM_BonyBeetle_Anim03, + STATUS_KEY_STATIC, ANIM_BonyBeetle_Anim07, + STATUS_KEY_PARALYZE, ANIM_BonyBeetle_Anim03, + STATUS_KEY_DIZZY, ANIM_BonyBeetle_Anim29, + STATUS_KEY_FEAR, ANIM_BonyBeetle_Anim29, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 4, + ELEMENT_END, +}; + +s32 N(DefenseTable_Flipped)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 60, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 75, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 75, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 85, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, -1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, -1, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -3, 21 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_spiky), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_FLIPABLE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -8 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_BONY_BEETLE, + .level = 25, + .maxHP = 8, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 50, + .airLiftChance = 70, + .hurricaneChance = 60, + .spookChance = 60, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 90, + .coinReward = 1, + .size = { 27, 27 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(init) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CALL(GetInstigatorValue, ACTOR_SELF, LVar1) + EVT_IF_EQ(LVar0, 1) + EVT_IF_EQ(LVar1, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim05) + EVT_ELSE + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_NORMAL)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_normal))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim04) + EVT_END_IF + EVT_ELSE + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 500) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_NORMAL)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_normal))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim04) + EVT_ELSE + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim05) + EVT_END_IF + EVT_END_IF +EVT_END_IF +EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) +EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) +EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE) +EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) +EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) +EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) +EVT_CALL(HPBarToHome, ACTOR_SELF) +EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 0) +EVT_RETURN +EVT_END +}; + +EvtScript N(idle) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(N(STATE_NORMAL)) + EVT_EXEC_WAIT(N(handleEvent_normal)) + EVT_CASE_EQ(N(STATE_SPIKY)) + EVT_EXEC_WAIT(N(handleEvent_spiky)) + EVT_CASE_EQ(N(STATE_FLIPPED)) + EVT_EXEC_WAIT(N(handleEvent_flipped)) + EVT_CASE_EQ(N(STATE_SPIKY_FLIPPED)) + EVT_EXEC_WAIT(N(handleEvent_spiky_flipped)) + EVT_END_SWITCH + EVT_CALL(ActorExists, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_EXEC_WAIT(N(changeSpikesState)) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 0) + EVT_END_IF + EVT_END_IF + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(changeSpikesState) = { + EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) + EVT_IF_LE(LVar0, 0) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_RETURN + EVT_END_IF + EVT_LABEL(0) + EVT_CALL(GetBattleFlags, LVarA) + EVT_IF_FLAG(LVarA, BS_FLAGS1_100) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(N(STATE_NORMAL)) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20CE) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY)) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim2E) + EVT_WAIT(25) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky))) + EVT_CASE_EQ(N(STATE_SPIKY)) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20CF) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_NORMAL)) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim2F) + EVT_WAIT(25) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_normal))) + EVT_CASE_EQ(N(STATE_FLIPPED)) + EVT_CASE_EQ(N(STATE_SPIKY_FLIPPED)) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(N(STATE_NORMAL)) + EVT_EXEC_WAIT(N(attackShellToss)) + EVT_CASE_EQ(N(STATE_SPIKY)) + EVT_EXEC_WAIT(N(attackSpikeBounce)) + EVT_CASE_EQ(N(STATE_FLIPPED)) + EVT_EXEC_WAIT(N(standUp)) + EVT_CASE_EQ(N(STATE_SPIKY_FLIPPED)) + EVT_EXEC_WAIT(N(standUp_spiky)) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +s32 N(FlipPosOffsets)[] = { 7, 13, 17, 21, 23, 24, 23, 21, 17, 13, 7, 0, 4, 6, 7, 6, 4, 0, 2, 0 }; + +EvtScript N(handleEvent_normal) = { + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1E) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim1F) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1E) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim1F) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1F) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_FLIP_TRIGGER) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_FLIPPED)) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim08) + EVT_USE_BUF(N(FlipPosOffsets)) + EVT_LOOP(20) + EVT_BUF_READ1(LVar0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_WAIT(20) + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim10) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_WAIT(20) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim12) + EVT_WAIT(10) + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0E) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim18) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(attackShellToss) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim16) + EVT_GOTO(100) + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim10) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(10) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(5) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim16) + EVT_WAIT(15) + EVT_LABEL(100) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D3) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim12) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim0E) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim04) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim12) + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim04) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_spiky) = { + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim20) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim21) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim20) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim21) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim21) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_WAS_HIT), 1) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_FLIP_TRIGGER) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY_FLIPPED)) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky_flipped))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim09) + EVT_USE_BUF(N(FlipPosOffsets)) + EVT_LOOP(20) + EVT_BUF_READ1(LVar0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_WAIT(20) + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0F) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim11) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_WAIT(20) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim13) + EVT_END_IF + EVT_WAIT(10) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_SPIKE_TAUNT) + EVT_WAIT(10) + EVT_SET(LFlag0, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, -3) + EVT_ADD(LVar1, 10) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_IF_FLAG(LVar3, STATUS_FLAG_DIZZY) + EVT_ADD(LVar0, 0) + EVT_ADD(LVar1, 26) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_IF_EQ(LFlag0, FALSE) + EVT_ADD(LVar0, -8) + EVT_ADD(LVar1, 26) + EVT_END_IF + EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) + EVT_WAIT(20) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim05) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0F) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim19) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(attackSpikeBounce) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim17) + EVT_WAIT(10) + EVT_GOTO(100) + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim11) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(10) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 6, 0, 10, 0) + EVT_WAIT(5) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 8, 0, 10, 0) + EVT_WAIT(5) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 10, 0, 10, 0) + EVT_WAIT(5) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 32, 12, 0, 10, 0) + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim17) + EVT_WAIT(15) + EVT_LABEL(100) + EVT_THREAD + EVT_LOOP(20) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_WALKING_DUST, 0, LVar0, LVar1, LVar2, 0, 0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D3) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 5, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(24.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, 0) + EVT_LOOP(10) + EVT_ADD(LVar0, 18) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.5)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, 180) + EVT_LOOP(15) + EVT_ADD(LVar0, 12) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, 0) + EVT_LOOP(10) + EVT_ADD(LVar0, 18) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, 180) + EVT_LOOP(5) + EVT_ADD(LVar0, 18) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_WAIT(5) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0F) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(24.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, 0) + EVT_LOOP(10) + EVT_ADD(LVar0, 18) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.5)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 5, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, 180) + EVT_LOOP(15) + EVT_ADD(LVar0, 12) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, 0) + EVT_LOOP(10) + EVT_ADD(LVar0, 18) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, 180) + EVT_LOOP(5) + EVT_ADD(LVar0, 18) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_WAIT(5) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim13) + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim0F) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(8021B7C8) = { + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_FLIPPED)) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim06) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar1, 24) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_301) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_flipped) = { + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim22) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim23) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim22) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim23) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim23) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_FLIP_TRIGGER) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_FLIPPED)) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1A) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) + EVT_USE_BUF(N(FlipPosOffsets)) + EVT_LOOP(20) + EVT_BUF_READ1(LVar0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_WAIT(20) + EVT_CASE_OR_EQ(EVENT_SCARE_AWAY) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1A) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(standUp) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), LVar0) + EVT_SUB(LVar0, 1) + EVT_IF_GT(LVar0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), LVar0) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1C) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim06) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_ELSE + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_15) + EVT_CALL(SetBattleCamZoom, 350) + EVT_CALL(SetBattleCamOffsetZ, 20) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1C) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim06) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim0A) + EVT_WAIT(20) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_NORMAL)) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_normal))) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_spiky_flipped) = { + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim24) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim25) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim24) + EVT_SET_CONST(LVar2, ANIM_BonyBeetle_Anim25) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim25) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_FLIP_TRIGGER) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY_FLIPPED)) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -8) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 21) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), 1) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky_flipped))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1B) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) + EVT_USE_BUF(N(FlipPosOffsets)) + EVT_LOOP(20) + EVT_BUF_READ1(LVar0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_WAIT(20) + EVT_CASE_OR_EQ(EVENT_SCARE_AWAY) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BonyBeetle_Anim1B) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(standUp_spiky) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), LVar0) + EVT_SUB(LVar0, 1) + EVT_IF_GT(LVar0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLIP_TRIGGERED), LVar0) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1D) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim07) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_ELSE + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_15) + EVT_CALL(SetBattleCamZoom, 350) + EVT_CALL(SetBattleCamOffsetZ, 20) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim1D) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim07) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BonyBeetle_Anim0B) + EVT_WAIT(20) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY)) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_spiky))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + diff --git a/src/battle/common/actor/bullet_bill.inc.c b/src/battle/common/actor/bullet_bill.inc.c new file mode 100644 index 0000000000..ff41a445e3 --- /dev/null +++ b/src/battle/common/actor/bullet_bill.inc.c @@ -0,0 +1,316 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/BulletBill.h" + +#define NAMESPACE A(bullet_bill) + +extern s32 N(DefaultAnims)[]; +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_MakeExplosionFX); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +enum N(ActorVars) { + AVAR_FiredFromBlaster = 0, + AVAR_BlasterID = 1, // actorID of Bill Blaster that fired this Bullet Bill +}; + +enum N(ActorParams) { + DMG_IMPACT = 2, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 0, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 100, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 0, + STATUS_KEY_SHRINK, 100, + STATUS_KEY_STOP, 0, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 16 }, + .opacity = 255, + .idleAnimations = N(DefaultAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAG_FIRE_EXPLODE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -6 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_BULLET_BILL, + .level = 5, + .maxHP = 2, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), + .escapeChance = 50, + .airLiftChance = 100, + .hurricaneChance = 100, + .spookChance = 0, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 85, + .coinReward = 0, + .size = { 28, 22 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(DefaultAnims)[] = { + STATUS_KEY_NORMAL, ANIM_BulletBill_Idle, + STATUS_KEY_STONE, ANIM_BulletBill_Still, + STATUS_KEY_STOP, ANIM_BulletBill_Still, + STATUS_KEY_PARALYZE, ANIM_BulletBill_Still, + STATUS_END, +}; + +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_FiredFromBlaster, LVar0) + EVT_IF_FALSE(LVar0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 16) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_ELSE + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_BlasterID, LVar0) + EVT_CALL(GetActorPos, LVar0, LVar1, LVar2, LVar3) + EVT_CALL(GetStatusFlags, LVar0, LVar4) + EVT_IF_FLAG(LVar4, STATUS_FLAG_SHRINK) + EVT_SET(LVar5, -13) + EVT_SET(LVar6, 4) + EVT_ELSE + EVT_SET(LVar5, -33) + EVT_SET(LVar6, 11) + EVT_END_IF + EVT_ADD(LVar1, LVar5) + EVT_ADD(LVar2, LVar6) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(CopyStatusEffects, LVar0, ACTOR_SELF) + EVT_CALL(CopyBuffs, LVar0, ACTOR_SELF) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(GetActorPos, LVar0, LVar1, LVarB, LVarC) + EVT_SUB(LVar1, 90) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BulletBill_Tense) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BulletBill_Idle) + EVT_CALL(ForceHomePos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Idle) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Explode) = { + EVT_EXEC_WAIT(N(EVS_MakeExplosionFX)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_BurnHurt) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_HandleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(EVENT_HIT_COMBO) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CASE_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_RETURN + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_RETURN + EVT_CASE_EQ(EVENT_EXPLODE_TRIGGER) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_EXEC_WAIT(N(EVS_Explode)) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Tense) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_Tense) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_TakeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BulletBill_Fire) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPresetImmediately, BTL_CAM_PRESET_19) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 2, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar3, LVar1) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_SET(LVar1, LVar3) + EVT_SUB(LVar0, 90) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(RemoveActor, ACTOR_SELF) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar3, LVar1) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_SET(LVar1, LVar3) + EVT_ADD(LVar0, 10) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 12, FALSE, TRUE, FALSE) + EVT_EXEC_WAIT(N(EVS_MakeExplosionFX)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, DMG_IMPACT, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_BulletBill_BurnHurt) + EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_MakeExplosionFX) = { + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar2, 2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_RING, 0, LVar0, LVar1, LVar2, 0) + EVT_ADD(LVar1, 16) + EVT_ADD(LVar2, 2) + EVT_PLAY_EFFECT(EFFECT_BLAST, 0, LVar0, LVar1, LVar2, EVT_FLOAT(3.0), 30, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2078) + EVT_CALL(StartRumble, 11) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) + EVT_END_THREAD + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/buzzy_beetle.inc.c b/src/battle/common/actor/buzzy_beetle.inc.c index 71799832ae..b47974f7da 100644 --- a/src/battle/common/actor/buzzy_beetle.inc.c +++ b/src/battle/common/actor/buzzy_beetle.inc.c @@ -4,6 +4,8 @@ #include "script_api/battle.h" #include "sprite/npc/BuzzyBeetle.h" +#define NAMESPACE A(buzzy_beetle) + extern s32 N(IdleAnimations)[]; extern EvtScript N(init); extern EvtScript N(idle); @@ -221,58 +223,58 @@ EvtScript N(handleEvent_ceiling) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim13) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim13) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(fallOff)) EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim13) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(fallOff)) EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim18) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(fallOff)) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim18) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim18) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim13) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim13) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim16) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim16) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_WAIT(2) @@ -281,18 +283,18 @@ EvtScript N(handleEvent_ceiling) = { EVT_EXEC_WAIT(N(fallOff)) EVT_END_IF EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim13) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim13) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, TRUE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim11) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim13) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -323,7 +325,7 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim19) EVT_EXEC_WAIT(N(setAnimation)) @@ -332,12 +334,12 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BURN_HIT) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_NE(LVar0, 2) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim0B) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim1D) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim1D) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -345,25 +347,25 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BURN_DEATH) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_NE(LVar0, 2) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim0B) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim1D) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim1D) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim1D) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_IF EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim19) EVT_EXEC_WAIT(N(setAnimation)) @@ -402,46 +404,46 @@ EvtScript N(handleEvent) = { EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BuzzyBeetle_Anim19) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_ZERO_DAMAGE) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BuzzyBeetle_Anim17) EVT_WAIT(8) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(EVENT_IMMUNE) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BuzzyBeetle_Anim0D) EVT_WAIT(8) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF @@ -457,25 +459,25 @@ EvtScript N(handleEvent) = { EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) EVT_WAIT(20) EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim19) EVT_EXEC_WAIT(N(setAnimation)) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim19) EVT_EXEC_WAIT(N(setAnimation)) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim19) EVT_EXEC_WAIT(N(setAnimation)) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim19) EVT_EXEC_WAIT(N(setAnimation)) @@ -484,40 +486,40 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_RECOVER_STATUS) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_END_IF EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim04) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim07) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim04) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim02) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim07) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim08) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_BlowAway) @@ -525,13 +527,13 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BuzzyBeetle_Anim0D) EVT_WAIT(8) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF @@ -671,7 +673,7 @@ EvtScript N(takeTurn_ceiling) = { EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) EVT_WAIT(8) EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BuzzyBeetle_Anim01) @@ -701,7 +703,7 @@ EvtScript N(takeTurn) = { EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) EVT_WAIT(20) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim02) EVT_SET_CONST(LVar2, ANIM_BuzzyBeetle_Anim01) EVT_EXEC_WAIT(EVS_Enemy_FlipBackUp) @@ -808,7 +810,7 @@ EvtScript N(takeTurn) = { EVT_WAIT(8) EVT_CALL(YieldTurn) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BuzzyBeetle_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BuzzyBeetle_Anim01) diff --git a/src/battle/common/actor/bzzap.inc.c b/src/battle/common/actor/bzzap.inc.c index 0805bab8fa..922b9adb18 100644 --- a/src/battle/common/actor/bzzap.inc.c +++ b/src/battle/common/actor/bzzap.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Bzzap.h" +#define NAMESPACE A(bzzap) + extern EvtScript N(init); extern EvtScript N(takeTurn); extern EvtScript N(idle); @@ -223,65 +224,65 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim07) EVT_SET_CONST(LVar2, ANIM_Bzzap_Anim08) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim07) EVT_SET_CONST(LVar2, ANIM_Bzzap_Anim08) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim08) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim06) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim06) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim06) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim06) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim06) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -292,18 +293,18 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(returnHome)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim03) EVT_SET_CONST(LVar2, ANIM_Bzzap_Anim06) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim01) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -315,7 +316,7 @@ EvtScript N(handleEvent) = { EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 9, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Bzzap_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_CASE_DEFAULT diff --git a/src/battle/common/actor/cleft.inc.c b/src/battle/common/actor/cleft.inc.c new file mode 100644 index 0000000000..ce4f2bc65e --- /dev/null +++ b/src/battle/common/actor/cleft.inc.c @@ -0,0 +1,552 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Cleft.h" + +#define NAMESPACE A(cleft) + +extern s32 N(IdleAnimations_80218838)[]; +extern EvtScript N(init_802188D0); +extern EvtScript N(idle_80218934); +extern EvtScript N(takeTurn_8021A3EC); +extern EvtScript N(handleEvent_80218C3C); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable_80218710)[] = { + ELEMENT_NORMAL, 2, + ELEMENT_FIRE, 99, + ELEMENT_MAGIC, 0, + ELEMENT_END, +}; + +s32 N(DefenseTable_8021872C)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_FIRE, 99, + ELEMENT_END, +}; + +s32 N(StatusTable_80218740)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 40, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 50, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 22 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80218838), + .defenseTable = N(DefenseTable_80218710), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_CLEFT, + .level = 10, + .maxHP = 2, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_802188D0), + .statusTable = N(StatusTable_80218740), + .escapeChance = 80, + .airLiftChance = 40, + .hurricaneChance = 40, + .spookChance = 40, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 95, + .coinReward = 2, + .size = { 44, 36 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_80218838)[] = { + STATUS_KEY_NORMAL, ANIM_Cleft_Anim02, + STATUS_KEY_STONE, ANIM_Cleft_Anim00, + STATUS_KEY_SLEEP, ANIM_Cleft_Anim0C, + STATUS_KEY_POISON, ANIM_Cleft_Anim02, + STATUS_KEY_STOP, ANIM_Cleft_Anim00, + STATUS_KEY_STATIC, ANIM_Cleft_Anim02, + STATUS_KEY_PARALYZE, ANIM_Cleft_Anim00, + STATUS_KEY_DIZZY, ANIM_Cleft_Anim0E, + STATUS_KEY_FEAR, ANIM_Cleft_Anim0E, + STATUS_END, +}; + +s32 N(IdleAnimations_80218884)[] = { + STATUS_KEY_NORMAL, ANIM_Cleft_Anim05, + STATUS_KEY_STONE, ANIM_Cleft_Anim01, + STATUS_KEY_SLEEP, ANIM_Cleft_Anim0D, + STATUS_KEY_POISON, ANIM_Cleft_Anim05, + STATUS_KEY_STOP, ANIM_Cleft_Anim01, + STATUS_KEY_STATIC, ANIM_Cleft_Anim05, + STATUS_KEY_PARALYZE, ANIM_Cleft_Anim01, + STATUS_KEY_DIZZY, ANIM_Cleft_Anim0F, + STATUS_KEY_FEAR, ANIM_Cleft_Anim0F, + STATUS_END, +}; + +#include "common/SetSpinSmashable.inc.c" + +#include "common/StartRumbleWithParams.inc.c" + +EvtScript N(init_802188D0) = { + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80218934))) + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021A3EC))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80218C3C))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_80218934) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(80218944) = { + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_THREAD + EVT_SET(LVar0, 0) + EVT_LOOP(5) + EVT_ADD(LVar0, -36) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) + EVT_SUB(LVar1, 6) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 200, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) + EVT_END_THREAD + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 40, 8, EVT_FLOAT(0.0), 20, 0) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218884))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_8021872C))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -7) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) + EVT_CALL(N(SetSpinSmashable), 0) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80218C3C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_CALL(GetLastElement, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_FLAG(DAMAGE_TYPE_BLAST) + EVT_EXEC_WAIT(N(80218944)) + EVT_CASE_DEFAULT + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_SWITCH + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_CALL(GetLastElement, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_FLAG(DAMAGE_TYPE_BLAST) + EVT_EXEC_WAIT(N(80218944)) + EVT_CASE_DEFAULT + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_END_IF + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE) + EVT_END_SWITCH + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_STAR_BEAM) + EVT_CASE_EQ(EVENT_SPIKE_TAUNT) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim18) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, -3) + EVT_ADD(LVar1, 10) + EVT_ELSE + EVT_ADD(LVar0, -8) + EVT_ADD(LVar1, 27) + EVT_END_IF + EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) + EVT_WAIT(20) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim03) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim02) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_END_IF + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim07) + EVT_SET_CONST(LVar2, ANIM_Cleft_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim0F) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim0F) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Anim08) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(802197AC) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(3.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) + EVT_WAIT(20) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim05) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_IF_GT(LVar0, 0) + EVT_SUB(LVar0, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, LVar0) + EVT_ELSE + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) + EVT_THREAD + EVT_WAIT(3) + EVT_LOOP(5) + EVT_ADD(LVar0, 36) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar1, 6) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 200, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) + EVT_END_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218838))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_80218710))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 22) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) + EVT_WAIT(1) + EVT_CALL(N(SetSpinSmashable), 1) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) + EVT_END_IF + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(80219BA0) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 30) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(10) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(5) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim10) + EVT_WAIT(10) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, -5) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim00) + EVT_WAIT(8) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 2, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_THREAD + EVT_WAIT(10) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_THREAD + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 100) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 45) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim08) + EVT_WAIT(15) + EVT_WAIT(8) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 15) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.4)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021A3EC) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_EXEC_WAIT(N(802197AC)) + EVT_ELSE + EVT_EXEC_WAIT(N(80219BA0)) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/clubba.inc.c b/src/battle/common/actor/clubba.inc.c index b8e29453b7..d41d0d6dd0 100644 --- a/src/battle/common/actor/clubba.inc.c +++ b/src/battle/common/actor/clubba.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleClubba.h" +#define NAMESPACE A(clubba) + extern EvtScript N(init); extern EvtScript N(takeTurn); extern EvtScript N(idle); @@ -113,86 +114,86 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim06) EVT_SET_CONST(LVar2, ANIM_BattleClubba_Anim07) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim06) EVT_SET_CONST(LVar2, ANIM_BattleClubba_Anim07) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim02) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim02) EVT_SET_CONST(LVar2, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -250,7 +251,7 @@ EvtScript N(takeTurn) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim02) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) @@ -277,7 +278,7 @@ EvtScript N(takeTurn) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_WAIT(19) EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Anim02) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_END_CASE_GROUP diff --git a/src/battle/common/actor/crazee_dayzee.inc.c b/src/battle/common/actor/crazee_dayzee.inc.c new file mode 100644 index 0000000000..ee91a985fa --- /dev/null +++ b/src/battle/common/actor/crazee_dayzee.inc.c @@ -0,0 +1,389 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Dayzee.h" + +#define NAMESPACE A(crazee_dayzee) + +extern EvtScript N(EVS_Init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); +extern s32 N(IdleAnimations)[]; + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 95, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 30, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 30, + STATUS_KEY_SHRINK, 30, + STATUS_KEY_STOP, 30, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -2, 30 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -8 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_CRAZEE_DAYZEE, + .level = 19, + .maxHP = 8, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), + .escapeChance = 50, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 100, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 75, + .coinReward = 2, + .size = { 32, 34 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -14, 17 }, + .statusTextOffset = { 9, 25 }, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_Dayzee_Anim01, + STATUS_KEY_STONE, ANIM_Dayzee_Anim00, + STATUS_KEY_SLEEP, ANIM_Dayzee_Anim0C, + STATUS_KEY_POISON, ANIM_Dayzee_Anim01, + STATUS_KEY_STOP, ANIM_Dayzee_Anim00, + STATUS_KEY_STATIC, ANIM_Dayzee_Anim01, + STATUS_KEY_PARALYZE, ANIM_Dayzee_Anim00, + STATUS_KEY_DIZZY, ANIM_Dayzee_Anim0B, + STATUS_KEY_FEAR, ANIM_Dayzee_Anim0B, + STATUS_END, +}; + +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(returnHome) = { + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim09) + EVT_SET_CONST(LVar2, ANIM_Dayzee_Anim0A) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim09) + EVT_SET_CONST(LVar2, ANIM_Dayzee_Anim0A) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim0A) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim04) + EVT_SET_CONST(LVar2, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 1, 0) + EVT_ELSE + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 3, 0) + EVT_END_IF + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Dayzee_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(attackPainfulSong) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorPos, ACTOR_SELF, -20, LVar1, LVar2) + EVT_ELSE + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 70) + EVT_SET(LFlag0, FALSE) + EVT_LABEL(0) + EVT_IF_EQ(LFlag0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim0E) + EVT_SET(LFlag0, TRUE) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim0F) + EVT_SET(LFlag0, FALSE) + EVT_END_IF + EVT_WAIT(1) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_IF_GT(LVar0, 0) + EVT_GOTO(0) + EVT_END_IF + EVT_IF_EQ(LFlag0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim0E) + EVT_SET(LFlag0, TRUE) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim0F) + EVT_SET(LFlag0, FALSE) + EVT_END_IF + EVT_WAIT(1) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(SetGoalPos, ACTOR_SELF, -35, 0, 10) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim01) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim06) + EVT_WAIT(40) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim07) + EVT_END_THREAD + EVT_WAIT(20) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_DAYZEE_SONG) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 25) + EVT_ADD(LVar2, 2) + EVT_LOOP(13) + EVT_CALL(RandInt, 30, LVar3) + EVT_SUB(LVar3, 15) + EVT_ADD(LVar3, LVar0) + EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 1, LVar3, LVar1, LVar2, 0) + EVT_WAIT(10) + EVT_END_LOOP + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim01) + EVT_WAIT(10) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_WAIT(15) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, DAMAGE_TYPE_NO_CONTACT, 0, DMG_STATUS_KEY(STATUS_FLAG_SLEEP, 3, 20), 4, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVarF) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(2) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 10) + EVT_WAIT(20) + EVT_CALL(YieldTurn) + EVT_EXEC_WAIT(N(returnHome)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(flee) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) + EVT_CALL(SetBattleCamZoom, 300) + EVT_CALL(SetBattleCamOffsetZ, 30) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) + EVT_CALL(MoveBattleCamOver, 30) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim03) + EVT_WAIT(10) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_WAIT(20) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(EnableActorBlur, ACTOR_SELF, 1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Dayzee_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) + EVT_ADD(LVar0, 200) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnableActorBlur, ACTOR_SELF, 0) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_BATTLE_FLED, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_CALL(RemoveActor, ACTOR_SELF) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_EXEC_WAIT(N(attackPainfulSong)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) + EVT_CALL(RandInt, 100, LVar1) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(1) + EVT_IF_LT(LVar1, 80) + EVT_EXEC_WAIT(N(flee)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(2) + EVT_IF_LT(LVar1, 40) + EVT_EXEC_WAIT(N(flee)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(3) + EVT_IF_LT(LVar1, 20) + EVT_EXEC_WAIT(N(flee)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(4) + EVT_IF_LT(LVar1, 10) + EVT_EXEC_WAIT(N(flee)) + EVT_RETURN + EVT_END_IF + EVT_END_SWITCH + EVT_EXEC_WAIT(N(attackPainfulSong)) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/dark_koopa.inc.c b/src/battle/common/actor/dark_koopa.inc.c new file mode 100644 index 0000000000..f889676673 --- /dev/null +++ b/src/battle/common/actor/dark_koopa.inc.c @@ -0,0 +1,890 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/KoopaTroopa.h" +#include "effects.h" + +#define NAMESPACE A(dark_koopa) + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); + +extern s32 N(IdleAnimations)[]; + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 2, + ELEMENT_SMASH, 2, + ELEMENT_JUMP, 2, + ELEMENT_WATER, 2, + ELEMENT_BLAST, 2, + ELEMENT_END, +}; + +s32 N(DefenseTable_Flipped)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 80, + STATUS_KEY_POISON, 60, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 80, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -2, 36 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAG_FLIPABLE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -7 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_DARK_KOOPA, + .level = 18, + .maxHP = 8, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 60, + .airLiftChance = 85, + .hurricaneChance = 75, + .spookChance = 70, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 90, + .coinReward = 2, + .size = { 28, 36 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -15, 32 }, + .statusTextOffset = { 5, 32 }, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Idle, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Idle, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Idle, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations_step)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations_active)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Scramble, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Scramble, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Scramble, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations_step_active)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations_flipped)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_ToppleStruggle, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_ToppleStill, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_ToppleSleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_ToppleStruggle, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_ToppleStill, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_ToppleStruggle, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_ToppleStill, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_ToppleStunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_ToppleStunned, + STATUS_END, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 300) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_ELSE + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) + EVT_END_IF + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(updateOffsets) = { + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_IF_FLAG(LVar1, STATUS_FLAG_SLEEP | STATUS_FLAG_DIZZY) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) + EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 32, 5, 32) + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_LABEL(0) + EVT_CALL(RandInt, 80, LVarA) + EVT_ADD(LVarA, 80) + EVT_LOOP(LVarA) + EVT_LABEL(1) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(updateOffsets)) + EVT_IF_EQ(LVar0, 2) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_EQ(LVar0, 3) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step_active))) + EVT_END_SWITCH + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_LOOP(20) + EVT_LABEL(2) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(updateOffsets)) + EVT_IF_EQ(LVar0, 2) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_IF_EQ(LVar0, 3) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step_active))) + EVT_END_SWITCH + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_LOOP(50) + EVT_LABEL(3) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(updateOffsets)) + EVT_IF_EQ(LVar0, 2) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF + EVT_IF_EQ(LVar0, 3) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) + EVT_THREAD + EVT_CALL(MakeLerp, 720, 0, 30, EASING_COS_IN_OUT) + EVT_LABEL(10) + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar1, 1) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar2) + EVT_IF_EQ(LVar2, 1) + EVT_WAIT(1) + EVT_GOTO(10) + EVT_END_IF + EVT_END_IF + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_END_THREAD + EVT_WAIT(8) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 1, ACTOR_DECORATION_WHIRLWIND) + EVT_WAIT(15) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) + EVT_WAIT(8) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_CASE_EQ(0) + EVT_CASE_EQ(2) + EVT_CASE_EQ(3) + EVT_END_SWITCH + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +s32 N(FlipPosOffsets)[] = { 9, 16, 22, 26, 30, 32, 33, 32, 30, 26, 22, 16, 9, 0, 4, 6, 7, 6, 4, 0, 2, 0 }; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_END_IF + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_FLIP_TRIGGER) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 2) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 3) + EVT_END_SWITCH + EVT_CALL(SetActorVar, ACTOR_SELF, 9, 1) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Hurt) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) + EVT_THREAD + EVT_WAIT(4) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 30) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -30) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -60) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -75) + EVT_WAIT(1) + EVT_END_THREAD + EVT_USE_BUF(N(FlipPosOffsets)) + EVT_LOOP(ARRAY_COUNT(N(FlipPosOffsets))) + EVT_BUF_READ1(LVar0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ShellEnter) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_WAIT(10) + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_END_IF + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Scramble) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_END_IF + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Panic) + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Panic) + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(attackShellToss) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) + EVT_ELSE + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 4) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(3) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) + EVT_WAIT(10) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_END_IF + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D3) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, 3, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) + EVT_CALL(AddGoalPos, ACTOR_SELF, -40, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_WAIT(8) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_WAIT(4) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic1) + EVT_WAIT(1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic2) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) + EVT_WAIT(6) + EVT_SUB(LVar1, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_WAIT(8) + EVT_CALL(YieldTurn) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(attackDizzyTornado) = { + EVT_LABEL(10) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar0, 1) + EVT_GOTO(10) + EVT_END_IF + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(AddGoalPos, ACTOR_SELF, 8, 0, 0) + EVT_ELSE + EVT_CALL(AddGoalPos, ACTOR_SELF, 20, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Run) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 4) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(3) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) + EVT_WAIT(20) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2026) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 1, ACTOR_DECORATION_WHIRLWIND) + EVT_WAIT(40) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, 0, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) + EVT_WAIT(10) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, SUPPRESS_EVENT_ALL, DMG_STATUS_KEY(STATUS_FLAG_DIZZY, 2, 60), 0, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_THREAD + EVT_CALL(WasStatusInflicted, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_CALL(MakeLerp, 0, 0x00000438, 30, EASING_COS_IN_OUT) + EVT_LABEL(0) + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF + EVT_END_IF + EVT_END_THREAD + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) + EVT_WAIT(10) + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(standUp) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetActorVar, ACTOR_SELF, 9, LVar0) + EVT_SUB(LVar0, 1) + EVT_IF_GT(LVar0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 9, LVar0) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_WAIT(30) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_ELSE + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_WAIT(20) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_JUMP_3E2) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_SET(LVar0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) + EVT_THREAD + EVT_LOOP(5) + EVT_ADD(LVar0, 15) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20BA) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(2) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_CASE_EQ(3) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) + EVT_END_SWITCH + EVT_END_IF + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_EXEC_WAIT(N(attackShellToss)) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 300) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_ELSE + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) + EVT_END_IF + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(attackDizzyTornado)) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 300) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_ELSE + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_active))) + EVT_END_IF + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_EXEC_WAIT(N(standUp)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + diff --git a/src/battle/common/actor/dark_paratroopa.inc.c b/src/battle/common/actor/dark_paratroopa.inc.c new file mode 100644 index 0000000000..72680a9b74 --- /dev/null +++ b/src/battle/common/actor/dark_paratroopa.inc.c @@ -0,0 +1,1442 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/ParaTroopa.h" +#include "sprite/npc/KoopaTroopa.h" +#include "effects.h" + +#define NAMESPACE A(dark_paratroopa) + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); +extern EvtScript N(nextTurn); +extern EvtScript N(fall); +extern EvtScript N(init_koopa); +extern EvtScript N(takeTurn_koopa); +extern EvtScript N(idle_koopa); +extern EvtScript N(handleEvent_koopa); + +extern s32 N(IdleAnimations)[]; +extern s32 N(IdleAnimations2)[]; +extern s32 N(IdleAnimations3)[]; + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 2, + ELEMENT_SMASH, 2, + ELEMENT_JUMP, 2, + ELEMENT_WATER, 2, + ELEMENT_BLAST, 2, + ELEMENT_END, +}; + +s32 N(defenseTable2)[] = { + ELEMENT_NORMAL, 2, + ELEMENT_END, +}; + +s32 N(DefenseTable_koopa_flipped)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_koopa)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 80, + STATUS_KEY_POISON, 60, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 80, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 80, + STATUS_KEY_POISON, 60, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 80, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -2, 36 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAG_FLIPABLE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -7 }, + }, + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -4, 36 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations2), + .defenseTable = N(defenseTable2), + .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 2, -14 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 32 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations3), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_DARK_PARATROOPA, + .level = 18, + .maxHP = 8, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 50, + .airLiftChance = 90, + .hurricaneChance = 80, + .spookChance = 70, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 85, + .coinReward = 2, + .size = { 50, 38 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 29 }, + .statusTextOffset = { 8, 30 }, +}; + +s32 N(IdleAnimations2)[] = { + STATUS_KEY_NORMAL, ANIM_ParaTroopa_Dark_Idle, + STATUS_KEY_STONE, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_ParaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_STOP, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_ParaTroopa_Dark_Idle, + STATUS_KEY_PARALYZE, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_ParaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_ParaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations_step)[] = { + STATUS_KEY_NORMAL, ANIM_ParaTroopa_Dark_Idle, + STATUS_KEY_STONE, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_ParaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_STOP, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_ParaTroopa_Dark_Idle, + STATUS_KEY_PARALYZE, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_ParaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_ParaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations3)[] = { + STATUS_KEY_NORMAL, ANIM_ParaTroopa_Dark_WingsStill, + STATUS_KEY_STONE, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_ParaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_STOP, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_ParaTroopa_Dark_WingsStill, + STATUS_KEY_PARALYZE, ANIM_ParaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_ParaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_ParaTroopa_Dark_Stunned, + STATUS_END, +}; + +EvtScript N(nextTurn) = { + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_RETURN + EVT_END +}; + +#include "common/StartRumbleWithParams.inc.c" +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(updateOffsets) = { + EVT_IF_FLAG(LVar1, STATUS_FLAG_SLEEP | STATUS_FLAG_DIZZY) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_2, 0, 25) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_2, 3, -6) + EVT_CALL(N(SetAbsoluteStatusOffsets), -19, 25, 4, 28) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_2, -2, 36) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_2, 0, -7) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 29, 8, 30) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_LABEL(10) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(updateOffsets)) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_step))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations2))) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(updateOffsets)) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_step))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations2))) + EVT_LOOP(40) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(updateOffsets)) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_GOTO(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(returnHome) = { + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Idle) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(EVENT_HIT_COMBO) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CASE_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(GetEncounterTrigger, LVar0) + EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) + EVT_EXEC_WAIT(N(fall)) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_ParaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_ParaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_FALL_TRIGGER) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_EXEC_WAIT(N(fall)) + EVT_CASE_EQ(EVENT_15) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnHurt) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_EXEC_WAIT(N(fall)) + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_ZERO_DAMAGE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_ShellEnter) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_ShellEnter) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(GetEncounterTrigger, LVar0) + EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) + EVT_EXEC_WAIT(N(fall)) + EVT_END_IF + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) + EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) + EVT_CALL(HPBarToCurrent, ACTOR_SELF) + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Run) + EVT_SET_CONST(LVar2, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_05) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 40, 30, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -16, EASING_LINEAR) + EVT_CALL(UseBattleCamPresetImmediately, BTL_CAM_PRESET_01) + EVT_WAIT(5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Windup) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(AddGoalPos, ACTOR_SELF, 6, 6, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) + EVT_WAIT(6) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 25) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(10.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_ShellDive) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) + EVT_SET(LVar0, 0) + EVT_LOOP(8) + EVT_ADD(LVar0, 90) + EVT_IF_GE(LVar0, 360) + EVT_SUB(LVar0, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, -10, 0) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Hurt) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Hurt) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 30) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_WAIT(20) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Windup) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(AddGoalPos, ACTOR_SELF, 6, 6, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) + EVT_WAIT(6) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(10.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_ShellDive) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 40, 30, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_ShellHit) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) + EVT_SET(LVar0, 0) + EVT_LOOP(12) + EVT_SUB(LVar0, 90) + EVT_IF_LT(LVar0, 0) + EVT_ADD(LVar0, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, -10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Dark_Idle) + EVT_END_THREAD + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 30, EASING_LINEAR) + EVT_WAIT(10) + EVT_CALL(YieldTurn) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_EXEC_WAIT(N(returnHome)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(fall) = { + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, 0, 0, 0) + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 8) + EVT_SUB(LVar2, 2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Hurt) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_IF_EQ(LVarA, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 128, 7) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) + EVT_END_THREAD + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_LOOP(10) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_WAIT(1) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_ELSE + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_THREAD + EVT_LOOP(10) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_WAIT(1) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_END_THREAD + EVT_CALL(N(StartRumbleWithParams), 150, 7) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) + EVT_END_THREAD + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_END_IF + EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) + EVT_MOD(LVar0, 4) + EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_koopa))) + EVT_CALL(BindNextTurn, ACTOR_SELF, 0) + EVT_EXEC_WAIT(N(init_koopa)) + EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_DARK_KOOPA) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_IF_NE(LVarA, 0) + EVT_CALL(DispatchEvent, ACTOR_SELF, EVENT_FLIP_TRIGGER) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Idle, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Idle, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Idle, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations_koopa_step)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations_koopa_active)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Scramble, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Scramble, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Scramble, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations_koopa_step_active)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned, + STATUS_END, +}; + +s32 N(IdleAnimations_koopa_flipped)[] = { + STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_ToppleStruggle, + STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_ToppleStill, + STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_ToppleSleep, + STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_ToppleStruggle, + STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_ToppleStill, + STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_ToppleStruggle, + STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_ToppleStill, + STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_ToppleStunned, + STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_ToppleStunned, + STATUS_END, +}; + +EvtScript N(init_koopa) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_koopa))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_koopa))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_koopa))) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 300) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_ELSE + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) + EVT_END_IF + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(updateOffsets_koopa) = { + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_IF_FLAG(LVar1, STATUS_FLAG_SLEEP | STATUS_FLAG_DIZZY) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) + EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 32, 5, 32) + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_koopa) = { + EVT_LABEL(0) + EVT_CALL(RandInt, 80, LVarA) + EVT_ADD(LVarA, 80) + EVT_LOOP(LVarA) + EVT_LABEL(1) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(updateOffsets_koopa)) + EVT_IF_EQ(LVar0, 2) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_EQ(LVar0, 3) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_step))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_step_active))) + EVT_END_SWITCH + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_flipped))) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_LOOP(20) + EVT_LABEL(2) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(updateOffsets_koopa)) + EVT_IF_EQ(LVar0, 2) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_IF_EQ(LVar0, 3) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_step))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_step_active))) + EVT_END_SWITCH + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_flipped))) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_LOOP(50) + EVT_LABEL(3) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(updateOffsets_koopa)) + EVT_IF_EQ(LVar0, 2) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF + EVT_IF_EQ(LVar0, 3) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) + EVT_THREAD + EVT_CALL(MakeLerp, 720, 0, 30, EASING_COS_IN_OUT) + EVT_LABEL(10) + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar1, 1) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar2) + EVT_IF_EQ(LVar2, 1) + EVT_WAIT(1) + EVT_GOTO(10) + EVT_END_IF + EVT_END_IF + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_END_THREAD + EVT_WAIT(8) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 1, ACTOR_DECORATION_WHIRLWIND) + EVT_WAIT(15) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) + EVT_WAIT(8) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_CASE_EQ(0) + EVT_CASE_EQ(2) + EVT_CASE_EQ(3) + EVT_END_SWITCH + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +s32 N(FlipPosOffsets)[] = { 9, 16, 22, 26, 30, 32, 33, 32, 30, 26, 22, 16, 9, 0, 4, 6, 7, 6, 4, 0, 2, 0 }; + +EvtScript N(handleEvent_koopa) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_END_IF + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_FLIP_TRIGGER) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 2) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 3) + EVT_END_SWITCH + EVT_CALL(SetActorVar, ACTOR_SELF, 9, 1) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_koopa_flipped))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_flipped))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Hurt) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) + EVT_THREAD + EVT_WAIT(4) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 30) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -30) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -60) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -75) + EVT_WAIT(1) + EVT_END_THREAD + EVT_USE_BUF(N(FlipPosOffsets)) + EVT_LOOP(ARRAY_COUNT(N(FlipPosOffsets))) + EVT_BUF_READ1(LVar0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ShellEnter) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_WAIT(10) + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_END_IF + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Scramble) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_END_IF + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Panic) + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Panic) + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(koopa_attackShellToss) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) + EVT_ELSE + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 4) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(3) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) + EVT_WAIT(10) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_END_IF + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D3) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, 3, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) + EVT_CALL(AddGoalPos, ACTOR_SELF, -40, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_WAIT(8) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_WAIT(4) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic1) + EVT_WAIT(1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic2) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) + EVT_WAIT(6) + EVT_SUB(LVar1, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(16.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, SUPPRESS_EVENT_ALL, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_WAIT(8) + EVT_CALL(YieldTurn) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(koopa_attackDizzyTornado) = { + EVT_LABEL(10) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar0, 1) + EVT_GOTO(10) + EVT_END_IF + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(AddGoalPos, ACTOR_SELF, 8, 0, 0) + EVT_ELSE + EVT_CALL(AddGoalPos, ACTOR_SELF, 20, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Run) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 4) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(3) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin) + EVT_WAIT(20) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2026) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 1, ACTOR_DECORATION_WHIRLWIND) + EVT_WAIT(40) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, 0, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) + EVT_WAIT(10) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, SUPPRESS_EVENT_ALL, DMG_STATUS_KEY(STATUS_FLAG_DIZZY, 2, 60), 0, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_THREAD + EVT_CALL(WasStatusInflicted, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_CALL(MakeLerp, 0, 0x00000438, 30, EASING_COS_IN_OUT) + EVT_LABEL(0) + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF + EVT_END_IF + EVT_END_THREAD + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 1) + EVT_WAIT(10) + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(koopa_standUp) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetActorVar, ACTOR_SELF, 9, LVar0) + EVT_SUB(LVar0, 1) + EVT_IF_GT(LVar0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 9, LVar0) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_WAIT(30) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_ELSE + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_WAIT(20) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(0.5)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_JUMP_3E2) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle) + EVT_SET(LVar0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) + EVT_THREAD + EVT_LOOP(5) + EVT_ADD(LVar0, 15) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20BA) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(2) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_CASE_EQ(3) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) + EVT_END_SWITCH + EVT_END_IF + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_koopa) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_EXEC_WAIT(N(koopa_attackShellToss)) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 300) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_ELSE + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) + EVT_END_IF + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(koopa_attackDizzyTornado)) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 300) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_ELSE + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_koopa_active))) + EVT_END_IF + EVT_CASE_OR_EQ(2) + EVT_CASE_OR_EQ(3) + EVT_EXEC_WAIT(N(koopa_standUp)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + diff --git a/src/battle/common/actor/dry_bones.inc.c b/src/battle/common/actor/dry_bones.inc.c new file mode 100644 index 0000000000..6f932b3540 --- /dev/null +++ b/src/battle/common/actor/dry_bones.inc.c @@ -0,0 +1,548 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/DryBones.h" + +#define NAMESPACE A(dry_bones) + +extern EvtScript N(init); +extern EvtScript N(idle); +extern EvtScript N(takeTurn); +extern EvtScript N(handleEvent); +extern EvtScript N(nextTurn); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_DryBones_Anim02, + STATUS_KEY_STONE, ANIM_DryBones_Anim00, + STATUS_KEY_SLEEP, ANIM_DryBones_Anim0E, + STATUS_KEY_POISON, ANIM_DryBones_Anim02, + STATUS_KEY_STOP, ANIM_DryBones_Anim00, + STATUS_KEY_STATIC, ANIM_DryBones_Anim02, + STATUS_KEY_PARALYZE, ANIM_DryBones_Anim00, + STATUS_KEY_DIZZY, ANIM_DryBones_Anim0D, + STATUS_KEY_FEAR, ANIM_DryBones_Anim0D, + STATUS_END, +}; + +s32 N(IdleAnimations_dead)[] = { + STATUS_KEY_NORMAL, ANIM_DryBones_Anim01, + STATUS_END, +}; + +s32 N(IdleAnimations_bone)[] = { + STATUS_KEY_NORMAL, ANIM_DryBones_Anim0F, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 2, + ELEMENT_FIRE, -10, + ELEMENT_BLAST, -10, + ELEMENT_END, +}; + +s32 N(DefenseTable_dead)[] = { + ELEMENT_NORMAL, 99, + ELEMENT_FIRE, -10, + ELEMENT_BLAST, -10, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 0, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 0, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 50, + STATUS_KEY_SHRINK, 60, + STATUS_KEY_STOP, 85, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, -1, + STATUS_END, +}; + +s32 N(StatusTable_dead)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 0, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 0, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 0, + STATUS_KEY_SHRINK, 0, + STATUS_KEY_STOP, 0, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -8, 30 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_bone), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_DRY_BONES, + .level = 30, + .maxHP = 8, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 50, + .airLiftChance = 75, + .hurricaneChance = 70, + .spookChance = 10, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 95, + .coinReward = 1, + .size = { 28, 32 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -15, 15 }, + .statusTextOffset = { 3, 27 }, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn))) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(nextTurn) = { + EVT_CALL(GetOriginalActorType, ACTOR_SELF, LVarA) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetOriginalActorType, LVar0, LVar2) + EVT_IF_NE(LVar2, LVarA) + EVT_CALL(GetActorHP, LVar0, LVar3) + EVT_IF_NE(LVar3, 0) + EVT_RETURN + EVT_END_IF + EVT_END_IF + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(1) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetActorVar, LVar0, 8, LVar3) + EVT_IF_NE(LVar3, 1) + EVT_RETURN + EVT_END_IF + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(2) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(SetActorFlagBits, LVar0, ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(2) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_LABEL(0) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_SWITCH(LVar1) + EVT_CASE_FLAG(STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -6, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 1, -5) + EVT_CASE_DEFAULT + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -8, 30) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_END_SWITCH + EVT_CASE_EQ(1) + EVT_SWITCH(LVar1) + EVT_CASE_FLAG(STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -1, 10) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CASE_DEFAULT + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -1, 10) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_END_SWITCH + EVT_END_SWITCH + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(reassemble) = { + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim08) + EVT_WAIT(20) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_dead))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_dead))) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_dead))) + EVT_CALL(ClearStatusEffects, ACTOR_SELF) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -1, 10) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(RandInt, 0, LVar0) + EVT_ADD(LVar0, 2) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CALL(GetOriginalActorType, ACTOR_SELF, LVarA) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetOriginalActorType, LVar0, LVar2) + EVT_IF_NE(LVar2, LVarA) + EVT_RETURN + EVT_END_IF + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(1) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetActorVar, LVar0, 8, LVar3) + EVT_IF_NE(LVar3, 1) + EVT_RETURN + EVT_END_IF + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(2) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(SetActorFlagBits, LVar0, ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(2) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(EVENT_HIT_COMBO) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CASE_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim0B) + EVT_SET_CONST(LVar2, ANIM_DryBones_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim0B) + EVT_SET_CONST(LVar2, ANIM_DryBones_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_EXEC_WAIT(N(reassemble)) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_WAIT(10) + EVT_EXEC_WAIT(N(reassemble)) + EVT_END_IF + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_END_IF + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim04) + EVT_SET_CONST(LVar2, ANIM_DryBones_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_END_IF + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, -1, -2, 0) + EVT_ELSE + EVT_CALL(SetActorDispOffset, ACTOR_SELF, -3, -5, 0) + EVT_END_IF + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_DryBones_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_IF + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(rotateBone) = { + EVT_SET(LVar0, 0) + EVT_LABEL(0) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_2, 0, 0, LVar0) + EVT_ADD(LVar0, 60) + EVT_MOD(LVar0, 360) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 1) + EVT_END_IF + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim06) + EVT_GOTO(100) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SUB(LVar0, 1) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim09) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D3) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim0A) + EVT_WAIT(20) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable))) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_2000, FALSE) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -8, 30) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_CALL(GetEnemyMaxHP, ACTOR_SELF, LVar0) + EVT_CALL(SetEnemyHP, ACTOR_SELF, LVar0) + EVT_ELSE + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim09) + EVT_WAIT(10) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, LVar0) + EVT_END_IF + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim05) + EVT_WAIT(15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim06) + EVT_THREAD + EVT_WAIT(8) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_DryBones_Anim02) + EVT_END_THREAD + EVT_LABEL(100) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) + EVT_ELSE + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_END_IF + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarF, LVar0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 20) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_WAIT(1) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_2, SOUND_2D1) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_WALK, 0, 0) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) + EVT_EXEC_GET_TID(N(rotateBone), LVarA) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 100) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_2, EVT_FLOAT(12.0)) + EVT_CALL(RunPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_KILL_THREAD(LVarA) + EVT_IF_EQ(LVarF, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(15) + EVT_CALL(YieldTurn) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_WAIT(20) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 20) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_WAIT(1) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_2, SOUND_2D1) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_WALK, 0, 0) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) + EVT_EXEC_GET_TID(N(rotateBone), LVarA) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_2, EVT_FLOAT(12.0)) + EVT_CALL(RunPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 100) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(0.7)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 30, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_KILL_THREAD(LVarA) + EVT_CALL(YieldTurn) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/duplighost.inc.c b/src/battle/common/actor/duplighost.inc.c index 29e97730dd..d90ec37cbc 100644 --- a/src/battle/common/actor/duplighost.inc.c +++ b/src/battle/common/actor/duplighost.inc.c @@ -1,9 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" #include "sprite/npc/Duplighost.h" +#define NAMESPACE A(duplighost) + extern EvtScript N(init); extern EvtScript N(takeTurn); extern EvtScript N(idle); @@ -136,7 +137,7 @@ EvtScript N(idle) = { }; EvtScript N(returnHome) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_RETURN @@ -150,85 +151,85 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0C) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0C) EVT_SET_CONST(LVar2, -1) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim02) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim04) EVT_SET_CONST(LVar2, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Duplighost_Anim0A) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -514,49 +515,49 @@ EvtScript N(OnShockDeath) = { Vec3i N(pos_summon) = { NPC_DISPOSE_LOCATION }; -#include "ghost_goombario.inc.c" +#include "duplighost/ghost_goombario.inc.c" Formation N(formation_goombario) = { ACTOR_BY_POS(N(goombario), N(pos_summon), 0), }; -#include "ghost_kooper.inc.c" +#include "duplighost/ghost_kooper.inc.c" Formation N(formation_kooper) = { ACTOR_BY_POS(N(kooper), N(pos_summon), 0), }; -#include "ghost_bombette.inc.c" +#include "duplighost/ghost_bombette.inc.c" Formation N(formation_bombette) = { ACTOR_BY_POS(N(bombette), N(pos_summon), 0), }; -#include "ghost_parakarry.inc.c" +#include "duplighost/ghost_parakarry.inc.c" Formation N(formation_parakarry) = { ACTOR_BY_POS(N(parakarry), N(pos_summon), 0), }; -#include "ghost_bow.inc.c" +#include "duplighost/ghost_bow.inc.c" Formation N(formation_bow) = { ACTOR_BY_POS(N(bow), N(pos_summon), 0), }; -#include "ghost_watt.inc.c" +#include "duplighost/ghost_watt.inc.c" Formation N(formation_watt) = { ACTOR_BY_POS(N(watt), N(pos_summon), 0), }; -#include "ghost_sushie.inc.c" +#include "duplighost/ghost_sushie.inc.c" Formation N(formation_sushie) = { ACTOR_BY_POS(N(sushie), N(pos_summon), 0), }; -#include "ghost_lakilester.inc.c" +#include "duplighost/ghost_lakilester.inc.c" Formation N(formation_lakilester) = { ACTOR_BY_POS(N(lakilester), N(pos_summon), 0), @@ -639,21 +640,21 @@ EvtScript N(copyPartner) = { EVT_CALL(N(CopyPriority), LVar5) EVT_SWITCH(LVar5) EVT_CASE_EQ(1) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_goombario)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_goombario)), FALSE) EVT_CASE_EQ(2) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_kooper)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_kooper)), FALSE) EVT_CASE_EQ(3) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bombette)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bombette)), FALSE) EVT_CASE_EQ(4) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_parakarry)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_parakarry)), FALSE) EVT_CASE_EQ(9) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bow)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_bow)), FALSE) EVT_CASE_EQ(6) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_watt)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_watt)), FALSE) EVT_CASE_EQ(7) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_sushie)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_sushie)), FALSE) EVT_CASE_EQ(8) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_lakilester)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_lakilester)), FALSE) EVT_END_SWITCH EVT_SET(LVarA, LVar0) EVT_CALL(CopyStatusEffects, ACTOR_SELF, LVarA) diff --git a/src/battle/common/actor/ghost_bombette.inc.c b/src/battle/common/actor/duplighost/ghost_bombette.inc.c similarity index 94% rename from src/battle/common/actor/ghost_bombette.inc.c rename to src/battle/common/actor/duplighost/ghost_bombette.inc.c index ffdf4a1347..36d1c81c72 100644 --- a/src/battle/common/actor/ghost_bombette.inc.c +++ b/src/battle/common/actor/duplighost/ghost_bombette.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleBombette.h" @@ -126,11 +125,11 @@ EvtScript N(bombette_handleEvent) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(GetLastElement, LVar1) @@ -140,46 +139,46 @@ EvtScript N(bombette_handleEvent) = { EVT_EXEC_WAIT(N(bombette_playEffects)) EVT_EXEC_WAIT(N(OnDeath)) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnStill) EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END_IF EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleBombette_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(bombette_playEffects)) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnStill) EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleBombette_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(bombette_playEffects)) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnStill) EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -191,7 +190,7 @@ EvtScript N(bombette_handleEvent) = { EVT_EXEC_WAIT(N(bombette_playEffects)) EVT_EXEC_WAIT(N(OnDeath)) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_BurnStill) EVT_SET(LVar2, EXEC_DEATH_NO_SPINNING) EVT_EXEC_WAIT(EVS_Enemy_Death) @@ -200,36 +199,36 @@ EvtScript N(bombette_handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Run) EVT_SET_CONST(LVar2, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/ghost_bow.inc.c b/src/battle/common/actor/duplighost/ghost_bow.inc.c similarity index 95% rename from src/battle/common/actor/ghost_bow.inc.c rename to src/battle/common/actor/duplighost/ghost_bow.inc.c index 5117449855..3e96a8bd34 100644 --- a/src/battle/common/actor/ghost_bow.inc.c +++ b/src/battle/common/actor/duplighost/ghost_bow.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleBow.h" @@ -127,95 +126,95 @@ EvtScript N(bow_handleEvent) = { EVT_CASE_OR_EQ(EVENT_HIT) EVT_CALL(GetLastElement, LVar1) EVT_IF_FLAG(LVar1, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(N(OnHitElectric)) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_BurnHurtAlt) EVT_SET_CONST(LVar2, ANIM_BattleBow_BurnStillAlt) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_BurnHurtAlt) EVT_SET_CONST(LVar2, ANIM_BattleBow_BurnStillAlt) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(OnDeath)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_BurnStillAlt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(N(OnShockHit)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_SET(LVar2, 14) EVT_EXEC_WAIT(N(OnShockDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Run) EVT_SET_CONST(LVar2, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/ghost_goombario.inc.c b/src/battle/common/actor/duplighost/ghost_goombario.inc.c similarity index 96% rename from src/battle/common/actor/ghost_goombario.inc.c rename to src/battle/common/actor/duplighost/ghost_goombario.inc.c index 9559858bbc..1cd9d7a135 100644 --- a/src/battle/common/actor/ghost_goombario.inc.c +++ b/src/battle/common/actor/duplighost/ghost_goombario.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleGoombario.h" @@ -139,93 +138,93 @@ EvtScript N(goombario_handleEvent) = { EVT_CASE_OR_EQ(EVENT_HIT) EVT_CALL(GetLastElement, LVar1) EVT_IF_FLAG(LVar1, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(N(OnHitElectric)) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_BurnHurt1) EVT_SET_CONST(LVar2, ANIM_BattleGoombario_BurnHurt2) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_BurnHurt1) EVT_SET_CONST(LVar2, ANIM_BattleGoombario_BurnHurt2) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(OnDeath)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_BurnHurt2) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(N(OnShockHit)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_SET(LVar2, 12) EVT_EXEC_WAIT(N(OnShockDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Run) EVT_SET_CONST(LVar2, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/ghost_kooper.inc.c b/src/battle/common/actor/duplighost/ghost_kooper.inc.c similarity index 96% rename from src/battle/common/actor/ghost_kooper.inc.c rename to src/battle/common/actor/duplighost/ghost_kooper.inc.c index a78f3776ed..74cd029df2 100644 --- a/src/battle/common/actor/ghost_kooper.inc.c +++ b/src/battle/common/actor/duplighost/ghost_kooper.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleKooper.h" @@ -180,41 +179,41 @@ EvtScript N(kooper_handleEvent) = { EVT_CASE_OR_EQ(EVENT_HIT) EVT_CALL(GetLastElement, LVar1) EVT_IF_FLAG(LVar1, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(N(OnHitElectric)) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleKooper_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleKooper_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -256,38 +255,38 @@ EvtScript N(kooper_handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Idle) EVT_CASE_EQ(1) EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Toppled) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Toppled) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_END_IF EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Run) EVT_SET_CONST(LVar2, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -296,11 +295,11 @@ EvtScript N(kooper_handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Run) EVT_CASE_EQ(1) EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(3.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Toppled) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_AirLift) @@ -316,10 +315,10 @@ EvtScript N(kooper_handleEvent) = { EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 3, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Toppled) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_BlowAway) diff --git a/src/battle/common/actor/ghost_lakilester.inc.c b/src/battle/common/actor/duplighost/ghost_lakilester.inc.c similarity index 94% rename from src/battle/common/actor/ghost_lakilester.inc.c rename to src/battle/common/actor/duplighost/ghost_lakilester.inc.c index 1b6702c267..12053c52f2 100644 --- a/src/battle/common/actor/ghost_lakilester.inc.c +++ b/src/battle/common/actor/duplighost/ghost_lakilester.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleLakilester.h" @@ -132,50 +131,50 @@ EvtScript N(lakilester_handleEvent) = { EVT_CASE_OR_EQ(EVENT_HIT) EVT_CALL(GetLastElement, LVar1) EVT_IF_FLAG(LVar1, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(N(OnHitElectric)) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(OnDeath)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleLakilester_Run) @@ -183,46 +182,46 @@ EvtScript N(lakilester_handleEvent) = { EVT_CALL(FlyToGoal, ACTOR_SELF, 30, 0, EASING_COS_IN_OUT) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Run) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/ghost_parakarry.inc.c b/src/battle/common/actor/duplighost/ghost_parakarry.inc.c similarity index 94% rename from src/battle/common/actor/ghost_parakarry.inc.c rename to src/battle/common/actor/duplighost/ghost_parakarry.inc.c index 4d3ba9c6f8..395fb2f672 100644 --- a/src/battle/common/actor/ghost_parakarry.inc.c +++ b/src/battle/common/actor/duplighost/ghost_parakarry.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleParakarry.h" @@ -127,89 +126,89 @@ EvtScript N(parakarry_handleEvent) = { EVT_CASE_OR_EQ(EVENT_HIT) EVT_CALL(GetLastElement, LVar1) EVT_IF_FLAG(LVar1, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(N(OnHitElectric)) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleParakarry_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleParakarry_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(OnDeath)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(N(OnShockHit)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_HurtStill) EVT_SET(LVar2, 22) EVT_EXEC_WAIT(N(OnShockDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Run) EVT_SET_CONST(LVar2, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -221,7 +220,7 @@ EvtScript N(parakarry_handleEvent) = { EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 3, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/ghost_sushie.inc.c b/src/battle/common/actor/duplighost/ghost_sushie.inc.c similarity index 96% rename from src/battle/common/actor/ghost_sushie.inc.c rename to src/battle/common/actor/duplighost/ghost_sushie.inc.c index 5ac44c1b41..de07245b3f 100644 --- a/src/battle/common/actor/ghost_sushie.inc.c +++ b/src/battle/common/actor/duplighost/ghost_sushie.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleSushie.h" @@ -111,93 +110,93 @@ EvtScript N(sushie_handleEvent) = { EVT_CASE_OR_EQ(EVENT_HIT) EVT_CALL(GetLastElement, LVar1) EVT_IF_FLAG(LVar1, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(N(OnHitElectric)) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleSushie_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleSushie_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(OnDeath)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(N(OnShockHit)) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_SET(LVar2, 20) EVT_EXEC_WAIT(N(OnShockDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Run) EVT_SET_CONST(LVar2, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/ghost_watt.inc.c b/src/battle/common/actor/duplighost/ghost_watt.inc.c similarity index 96% rename from src/battle/common/actor/ghost_watt.inc.c rename to src/battle/common/actor/duplighost/ghost_watt.inc.c index a29c1e15c8..e67f6f4bf9 100644 --- a/src/battle/common/actor/ghost_watt.inc.c +++ b/src/battle/common/actor/duplighost/ghost_watt.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleWatt.h" @@ -262,74 +261,74 @@ EvtScript N(watt_handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleWatt_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_BurnHurt) EVT_SET_CONST(LVar2, ANIM_BattleWatt_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CALL(N(UnkWattEffectFunc2)) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) EVT_CALL(N(UnkWattEffectFunc2)) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_CALL(N(UnkWattEffectFunc2)) EVT_EXEC_WAIT(N(OnDeath)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Run) EVT_SET_CONST(LVar2, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/ember.inc.c b/src/battle/common/actor/ember.inc.c index e6dad4ff1f..8405cd94ae 100644 --- a/src/battle/common/actor/ember.inc.c +++ b/src/battle/common/actor/ember.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/LavaBubble.h" +#define NAMESPACE A(ember) + extern s32 N(IdleAnimations_8021AE5C)[]; extern s32 N(IdleAnimations_8021AEA8)[]; @@ -300,7 +301,7 @@ EvtScript N(split) = { EVT_RETURN EVT_END_IF EVT_CALL(GetLastElement, LVar0) - EVT_IF_FLAG(LVar0, 0x20000000) + EVT_IF_FLAG(LVar0, DAMAGE_TYPE_MULTIPLE_POPUPS) // interesting use-case EVT_RETURN EVT_END_IF EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) @@ -313,7 +314,7 @@ EvtScript N(split) = { EVT_CASE_OR_EQ(1) EVT_CASE_OR_EQ(2) EVT_CASE_OR_EQ(3) - EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8021B5A0)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8021B5A0)), FALSE) EVT_CALL(SetActorVar, LVar0, 2, 1) EVT_CALL(GetActorHP, ACTOR_SELF, LVarB) EVT_CALL(SetEnemyHP, LVar0, LVarB) @@ -349,53 +350,53 @@ EvtScript N(handleEvent_8021B8BC) = { EVT_CASE_OR_EQ(9) EVT_CASE_OR_EQ(10) EVT_EXEC(N(split)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(14) EVT_EXEC(N(split)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim08) EVT_SET_CONST(LVar2, ANIM_LavaBubble_Blue_Anim09) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(36) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim08) EVT_SET_CONST(LVar2, ANIM_LavaBubble_Blue_Anim09) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(11) EVT_EXEC(N(split)) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(33) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(47) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_EXEC_WAIT(N(8021B2FC)) EVT_CASE_EQ(38) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -403,15 +404,15 @@ EvtScript N(handleEvent_8021B8BC) = { EVT_CASE_OR_EQ(25) EVT_CASE_OR_EQ(31) EVT_CASE_OR_EQ(28) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(32) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -422,21 +423,21 @@ EvtScript N(handleEvent_8021B8BC) = { EVT_EXEC_WAIT(N(8021B2FC)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(49) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(57) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim03) EVT_SET_CONST(LVar2, ANIM_LavaBubble_Blue_Anim07) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(58) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim03) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(22) - EVT_SET_CONST(LVar0, 0x00000001) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LavaBubble_Blue_Anim03) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -537,7 +538,7 @@ EvtScript N(8021C454) = { EVT_LOOP(4) EVT_THREAD EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) - EVT_IF_FLAG(LVarA, 0x80000) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) EVT_CALL(SetPartScale, ACTOR_SELF, LVar6, EVT_FLOAT(0.2), EVT_FLOAT(0.2), EVT_FLOAT(0.2)) EVT_ELSE EVT_CALL(SetPartScale, ACTOR_SELF, LVar6, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) @@ -759,7 +760,7 @@ EvtScript N(takeTurn_8021D284) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(1) EVT_CALL(GetStatusFlags, ACTOR_PARTNER, LVar0) - EVT_IF_FLAG(LVar0, 0x1000000) + EVT_IF_FLAG(LVar0, STATUS_FLAG_KO) EVT_EXEC_WAIT(N(8021BE64)) EVT_ELSE EVT_CALL(RandInt, 1000, LVar0) @@ -771,7 +772,7 @@ EvtScript N(takeTurn_8021D284) = { EVT_END_IF EVT_CASE_EQ(0) EVT_CALL(GetStatusFlags, ACTOR_PARTNER, LVar0) - EVT_IF_FLAG(LVar0, 0x1000000) + EVT_IF_FLAG(LVar0, STATUS_FLAG_KO) EVT_EXEC_WAIT(N(8021CBC8)) EVT_ELSE EVT_CALL(RandInt, 1000, LVar0) diff --git a/src/battle/common/actor/forest_fuzzy.inc.c b/src/battle/common/actor/forest_fuzzy.inc.c new file mode 100644 index 0000000000..6080c1d71d --- /dev/null +++ b/src/battle/common/actor/forest_fuzzy.inc.c @@ -0,0 +1,663 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Fuzzy.h" + +#define NAMESPACE A(forest_fuzzy) + +extern s32 N(IdleAnimations_802184C4)[]; +extern EvtScript N(init_80218510); +extern EvtScript N(takeTurn_8021A61C); +extern EvtScript N(idle_80218574); +extern EvtScript N(handleEvent_80218584); +extern Formation N(specialFormation_8021A800); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable_802183C0)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_802183CC)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 95, + STATUS_KEY_POISON, 90, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 70, + STATUS_KEY_PARALYZE, 75, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 20 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_802184C4), + .defenseTable = N(DefenseTable_802183C0), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_FOREST_FUZZY, + .level = 11, + .maxHP = 6, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_80218510), + .statusTable = N(StatusTable_802183CC), + .escapeChance = 40, + .airLiftChance = 90, + .hurricaneChance = 90, + .spookChance = 85, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 33, 28 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_802184C4)[] = { + STATUS_KEY_NORMAL, ANIM_Fuzzy_Forest_Idle, + STATUS_KEY_STONE, ANIM_Fuzzy_Forest_Still, + STATUS_KEY_SLEEP, ANIM_Fuzzy_Forest_Sleep, + STATUS_KEY_POISON, ANIM_Fuzzy_Forest_Idle, + STATUS_KEY_STOP, ANIM_Fuzzy_Forest_Still, + STATUS_KEY_STATIC, ANIM_Fuzzy_Forest_Idle, + STATUS_KEY_PARALYZE, ANIM_Fuzzy_Forest_Still, + STATUS_KEY_DIZZY, ANIM_Fuzzy_Forest_Stunned, + STATUS_KEY_FEAR, ANIM_Fuzzy_Forest_Stunned, + STATUS_END, +}; + +EvtScript N(init_80218510) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021A61C))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80218574))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80218584))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_80218574) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80218584) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_CALL(GetLastElement, LVar0) + EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Burn) + EVT_SET_CONST(LVar2, ANIM_Fuzzy_Forest_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Burn) + EVT_SET_CONST(LVar2, ANIM_Fuzzy_Forest_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_CALL(func_80269470) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Run) + EVT_EXEC_WAIT(EVS_Enemy_HopHome) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_CALL(func_80269470) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_CALL(GetLastElement, LVar0) + EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Run) + EVT_SET_CONST(LVar2, ANIM_Fuzzy_Forest_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Run) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Forest_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(80218C48) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) + EVT_CALL(SetBattleCamZoom, 330) + EVT_CALL(SetBattleCamOffsetZ, 30) + EVT_CALL(MoveBattleCamOver, 20) + EVT_WAIT(20) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) + EVT_THREAD + EVT_WAIT(30) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206E) + EVT_WAIT(30) + EVT_LOOP(4) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206F) + EVT_WAIT(11) + EVT_END_LOOP + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2070) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Anim0D) + EVT_WAIT(130) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Walk) + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8021A800)), FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(SetActorPos, LVar0, LVar1, LVar2, LVar3) + EVT_CALL(SetGoalToIndex, LVar0, LVarA) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 20) + EVT_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Walk) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(JumpToGoal, ACTOR_SELF, 14, FALSE, TRUE, FALSE) + EVT_END_THREAD + EVT_WAIT(1) + EVT_CALL(SetAnimation, LVar0, 1, ANIM_Fuzzy_Forest_Walk) + EVT_CALL(SetActorJumpGravity, LVar0, EVT_FLOAT(1.4)) + EVT_CALL(JumpToGoal, LVar0, 14, FALSE, TRUE, FALSE) + EVT_CALL(GetActorPos, LVar0, LVar1, LVar2, LVar3) + EVT_CALL(ForceHomePos, LVar0, LVar1, LVar2, LVar3) + EVT_CALL(HPBarToHome, LVar0) + EVT_CALL(SetAnimation, LVar0, 1, ANIM_Fuzzy_Forest_Idle) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar1) + EVT_SWITCH(LVar1) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, LVar0, 0, 1) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, LVar0, 0, 2) + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/SpawnEnemyDrainFX.inc.c" + +EvtScript N(80219054) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_GOTO(100) + EVT_END_IF + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Idle) + EVT_LABEL(100) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Anim04) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 9, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) + EVT_WAIT(5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_SET(LVar1, 0) + EVT_SUB(LVar2, 5) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Jump) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 11, FALSE, TRUE, FALSE) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Anim09) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 15) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_WAIT(4) + EVT_WAIT(5) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(5) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_EQ(HIT_RESULT_HIT_STATIC) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_STATIC) + EVT_SET(LFlag0, FALSE) + EVT_ELSE + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, -3, -12, -15) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Jump) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 0, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_RETURN + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE) + EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Leeching) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Bite) + EVT_WAIT(21) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Still) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, -3, -2, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.9), EVT_FLOAT(1.2), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.8), EVT_FLOAT(1.3), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) + EVT_WAIT(2) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.6), EVT_FLOAT(1.6), EVT_FLOAT(1.0)) + EVT_WAIT(10) + EVT_WAIT(2) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Idle) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar3) + EVT_IF_NE(LVar3, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_214) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 10) + EVT_CALL(N(SpawnDrainHealthStartFX), LVar0, LVar1, LVar2, LVar3) + EVT_THREAD + EVT_WAIT(15) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_25C) + EVT_CALL(N(SpawnDrainHealthContinueFX), LVar0, LVar1, LVar2, LVar3) + EVT_END_THREAD + EVT_ADD(LVar0, 20) + EVT_ADD(LVar1, 20) + EVT_PLAY_EFFECT(EFFECT_RECOVER, 0, LVar0, LVar1, LVar2, LVar3, 0) + EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) + EVT_ADD(LVar0, LVar3) + EVT_CALL(SetEnemyHP, ACTOR_SELF, LVar0) + EVT_END_IF + EVT_THREAD + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.6), EVT_FLOAT(0.6), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 300) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 270) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(0.7), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 240) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 210) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 180) + EVT_WAIT(2) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(0.7), EVT_FLOAT(1.0)) + EVT_WAIT(2) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.2), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_END_THREAD + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.4), EVT_FLOAT(0.2), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.2), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 150) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 120) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 90) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 60) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 30) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Idle) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021A0D4) = { + EVT_SET(LFlag1, FALSE) + EVT_SET(LFlag2, FALSE) + EVT_SET(LFlag3, FALSE) + EVT_SET(LFlag4, FALSE) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar5) + EVT_CALL(GetIndexFromHome, LVar0, LVar5) + EVT_MOD(LVar5, 4) + EVT_SWITCH(LVar5) + EVT_CASE_EQ(0) + EVT_SET(LFlag1, TRUE) + EVT_CASE_EQ(1) + EVT_SET(LFlag2, TRUE) + EVT_CASE_EQ(2) + EVT_SET(LFlag3, TRUE) + EVT_CASE_EQ(3) + EVT_SET(LFlag4, TRUE) + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_SET(LVarA, -1) + EVT_SET(LVarB, -1) + EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_IF_EQ(LFlag2, FALSE) + EVT_SET(LVarA, 1) + EVT_END_IF + EVT_CASE_EQ(1) + EVT_IF_EQ(LFlag1, FALSE) + EVT_SET(LVarA, 0) + EVT_END_IF + EVT_IF_EQ(LFlag3, FALSE) + EVT_IF_EQ(LVarA, -1) + EVT_SET(LVarA, 2) + EVT_ELSE + EVT_SET(LVarB, 2) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(2) + EVT_IF_EQ(LFlag2, FALSE) + EVT_SET(LVarA, 1) + EVT_END_IF + EVT_IF_EQ(LFlag4, FALSE) + EVT_IF_EQ(LVarA, -1) + EVT_SET(LVarA, 3) + EVT_ELSE + EVT_SET(LVarB, 3) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(3) + EVT_IF_EQ(LFlag3, FALSE) + EVT_SET(LVarA, 2) + EVT_END_IF + EVT_END_SWITCH + EVT_IF_NE(LVarB, -1) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 500) + EVT_SET(LVarA, LVarB) + EVT_END_IF + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(8021A45C) = { + EVT_SET(LVar9, 0) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetOriginalActorType, LVar0, LVar2) + EVT_SWITCH(LVar2) + EVT_CASE_OR_EQ(ACTOR_TYPE_FOREST_FUZZY) + EVT_CASE_OR_EQ(ACTOR_TYPE_JUNGLE_FUZZY) + EVT_CALL(GetStatusFlags, LVar0, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(GetActorVar, LVar0, 0, LVar3) + EVT_IF_NE(LVar3, 2) + EVT_ADD(LVar9, 1) + EVT_END_IF + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(ACTOR_TYPE_SPEAR_GUY) + EVT_CALL(GetStatusFlags, LVar0, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(GetActorVar, LVar0, 1, LVar3) + EVT_IF_LT(LVar3, 2) + EVT_ADD(LVar9, 1) + EVT_END_IF + EVT_END_IF + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021A61C) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_EXEC_WAIT(N(80219054)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 2) + EVT_EXEC_WAIT(N(80219054)) + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(8021A0D4)) + EVT_IF_EQ(LVarA, -1) + EVT_EXEC_WAIT(N(80219054)) + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(8021A45C)) + EVT_SWITCH(LVar9) + EVT_CASE_EQ(1) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 300) + EVT_EXEC_WAIT(N(80218C48)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(2) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 150) + EVT_EXEC_WAIT(N(80218C48)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(3) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 100) + EVT_EXEC_WAIT(N(80218C48)) + EVT_RETURN + EVT_END_IF + EVT_END_SWITCH + EVT_EXEC_WAIT(N(80219054)) + EVT_RETURN + EVT_END +}; + +Vec3i N(vector3D_8021A7F4) = { NPC_DISPOSE_LOCATION }; + +Formation N(specialFormation_8021A800) = { + ACTOR_BY_POS(NAMESPACE, N(vector3D_8021A7F4), 0), +}; diff --git a/src/battle/common/actor/frost_piranha.inc.c b/src/battle/common/actor/frost_piranha.inc.c new file mode 100644 index 0000000000..22cb4fb8c5 --- /dev/null +++ b/src/battle/common/actor/frost_piranha.inc.c @@ -0,0 +1,485 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "effects.h" +#include "sprite/npc/LargePiranha.h" + +#define NAMESPACE A(frost_piranha) + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); +extern EvtScript N(attack_bite); +extern EvtScript N(attack_icy_breath); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_LargePiranha_Frost_Anim01, + STATUS_KEY_STONE, ANIM_LargePiranha_Frost_Anim00, + STATUS_KEY_SLEEP, ANIM_LargePiranha_Frost_Anim00, + STATUS_KEY_POISON, ANIM_LargePiranha_Frost_Anim01, + STATUS_KEY_STOP, ANIM_LargePiranha_Frost_Anim00, + STATUS_KEY_STATIC, ANIM_LargePiranha_Frost_Anim00, + STATUS_KEY_PARALYZE, ANIM_LargePiranha_Frost_Anim00, + STATUS_KEY_PARALYZE, ANIM_LargePiranha_Frost_Anim00, + STATUS_KEY_DIZZY, ANIM_LargePiranha_Frost_Anim0F, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_FIRE, -2, + ELEMENT_ICE, 99, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 95, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 85, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -15, 50 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAG_ICY, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 3, -14 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_FROST_PIRANHA, + .level = 22, + .maxHP = 10, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 70, + .airLiftChance = 20, + .hurricaneChance = 20, + .spookChance = 20, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 90, + .coinReward = 1, + .size = { 60, 52 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -22, 32 }, + .statusTextOffset = { 1, 44 }, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_DIZZY) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -27, 33) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 5, -11) + EVT_CALL(N(SetAbsoluteStatusOffsets), -37, 9, -7, 31) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -15, 50) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 3, -14) + EVT_CALL(N(SetAbsoluteStatusOffsets), -22, 32, 1, 44) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(return_home) = { + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim01) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim10) + EVT_SET_CONST(LVar2, ANIM_LargePiranha_Frost_Anim11) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim10) + EVT_SET_CONST(LVar2, ANIM_LargePiranha_Frost_Anim11) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim11) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(return_home)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim03) + EVT_SET_CONST(LVar2, ANIM_LargePiranha_Frost_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LargePiranha_Frost_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_EXEC_WAIT(N(attack_bite)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_FROZEN) + EVT_EXEC_WAIT(N(attack_bite)) + EVT_RETURN + EVT_END_IF + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 250) + EVT_EXEC_WAIT(N(attack_icy_breath)) + EVT_ELSE + EVT_EXEC_WAIT(N(attack_bite)) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(attack_bite) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim18) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_WAIT(8) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 27) + EVT_SET(LVar1, 0) + EVT_SET(LVar3, LVar0) + EVT_SET(LVar4, LVar1) + EVT_SET(LVar5, LVar2) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar6, LVar7, LVar8) + EVT_ADD(LVar3, LVar6) + EVT_ADD(LVar4, LVar7) + EVT_ADD(LVar5, LVar8) + EVT_DIV(LVar3, 2) + EVT_DIV(LVar4, 2) + EVT_DIV(LVar5, 2) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) + EVT_CALL(SetBattleCamTarget, LVar3, LVar4, LVar5) + EVT_CALL(SetBattleCamZoom, 300) + EVT_CALL(SetBattleCamOffsetZ, 40) + EVT_WAIT(20) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim17) + EVT_WAIT(8) + EVT_ELSE + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, 10) + EVT_ELSE + EVT_ADD(LVar0, 27) + EVT_END_IF + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim01) + EVT_END_IF + EVT_THREAD + EVT_WAIT(8) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DE) + EVT_END_THREAD + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVarA) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim05) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim06) + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim07) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(14) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim18) + EVT_WAIT(10) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim17) + EVT_WAIT(10) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) + EVT_ELSE + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_EXEC_WAIT(N(return_home)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_END_IF + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim05) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim06) + EVT_WAIT(1) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SET(LVarF, LVar0) + EVT_SWITCH(LVarF) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim07) + EVT_WAIT(20) + EVT_CALL(YieldTurn) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim18) + EVT_WAIT(10) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim17) + EVT_WAIT(10) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) + EVT_ELSE + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(return_home)) + EVT_END_IF + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/UnkEffect6FFunc.inc.c" + +EvtScript N(attack_icy_breath) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim03) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, 20) + EVT_ELSE + EVT_ADD(LVar0, 50) + EVT_END_IF + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim01) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim0B) + EVT_WAIT(11) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3AB) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, 12) + EVT_SET(LVar1, 5) + EVT_SETF(LVar3, EVT_FLOAT(0.4)) + EVT_ELSE + EVT_ADD(LVar0, 32) + EVT_SET(LVar1, 13) + EVT_SETF(LVar3, EVT_FLOAT(1.0)) + EVT_END_IF + EVT_CALL(N(UnkEffect6FFunc), LVar2, LVar0, LVar1, LVar2, LVar3, 30, 120, 0, 120) + EVT_WAIT(1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim0C) + EVT_WAIT(5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_ICE, STATUS_FLAG_FROZEN, 1, BS_FLAGS1_10) //@bug malformed status word + EVT_SWITCH(LVarA) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim0D) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(14) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_EXEC_WAIT(N(return_home)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_ICE | DAMAGE_TYPE_STATUS_ALWAYS_HITS, SUPPRESS_EVENT_ALL, DMG_STATUS_IGNORE_RES(STATUS_FLAG_FROZEN, 2), 0, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SET(LVarF, LVar0) + EVT_SWITCH(LVarF) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LargePiranha_Frost_Anim0D) + EVT_WAIT(20) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(return_home)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/fuzzy.inc.c b/src/battle/common/actor/fuzzy.inc.c index 9a946dd691..6524216581 100644 --- a/src/battle/common/actor/fuzzy.inc.c +++ b/src/battle/common/actor/fuzzy.inc.c @@ -1,13 +1,24 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Fuzzy.h" #include "effects.h" +#define NAMESPACE A(fuzzy) + +extern s32 N(DefaultAnims)[]; +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); + enum N(ActorPartIDs) { PRT_MAIN = 1, }; +enum N(ActorParams) { + DMG_DRAIN = 1, +}; + s32 N(DefenseTable)[] = { ELEMENT_NORMAL, 0, ELEMENT_END, @@ -38,8 +49,6 @@ s32 N(StatusTable)[] = { STATUS_END, }; -extern s32 N(IdleAnimations)[]; - ActorPartBlueprint N(ActorParts)[] = { { .flags = ACTOR_PART_FLAG_MULTI_TARGET, @@ -47,7 +56,7 @@ ActorPartBlueprint N(ActorParts)[] = { .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 20 }, .opacity = 255, - .idleAnimations = N(IdleAnimations), + .idleAnimations = N(DefaultAnims), .defenseTable = N(DefenseTable), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, @@ -55,8 +64,6 @@ ActorPartBlueprint N(ActorParts)[] = { }, }; -extern EvtScript N(init); - ActorBlueprint NAMESPACE = { .flags = 0, .type = ACTOR_TYPE_FUZZY, @@ -64,7 +71,7 @@ ActorBlueprint NAMESPACE = { .maxHP = 3, .partCount = ARRAY_COUNT(N(ActorParts)), .partsData = N(ActorParts), - .initScript = &N(init), + .initScript = &N(EVS_Init), .statusTable = N(StatusTable), .escapeChance = 50, .airLiftChance = 95, @@ -80,7 +87,7 @@ ActorBlueprint NAMESPACE = { .statusTextOffset = { 10, 20 }, }; -s32 N(IdleAnimations)[] = { +s32 N(DefaultAnims)[] = { STATUS_KEY_NORMAL, ANIM_Fuzzy_Idle, STATUS_KEY_STONE, ANIM_Fuzzy_Still, STATUS_KEY_SLEEP, ANIM_Fuzzy_Sleep, @@ -93,24 +100,20 @@ s32 N(IdleAnimations)[] = { STATUS_END, }; -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) EVT_RETURN EVT_END }; -EvtScript N(idle) = { +EvtScript N(EVS_Idle) = { EVT_RETURN EVT_END }; -EvtScript N(handleEvent) = { +EvtScript N(EVS_HandleEvent) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) @@ -120,104 +123,104 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_HIT) EVT_CALL(GetLastElement, LVar0) EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_HurtShock) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Hurt) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Burn) EVT_SET_CONST(LVar2, ANIM_Fuzzy_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Burn) EVT_SET_CONST(LVar2, ANIM_Fuzzy_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_HurtShock) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_HurtShock) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Run) EVT_EXEC_WAIT(EVS_Enemy_HopHome) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_HurtShock) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_CALL(GetLastElement, LVar0) EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_HurtShock) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_HurtShock) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_IF EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Run) EVT_SET_CONST(LVar2, ANIM_Fuzzy_Anim09) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Fuzzy_Run) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -231,7 +234,7 @@ EvtScript N(handleEvent) = { #include "common/SpawnEnemyDrainFX.inc.c" -EvtScript N(takeTurn) = { +EvtScript N(EVS_TakeTurn) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) @@ -352,7 +355,7 @@ EvtScript N(takeTurn) = { EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.6), EVT_FLOAT(1.6), EVT_FLOAT(1.0)) EVT_WAIT(10) EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, DMG_DRAIN, BS_FLAGS1_SP_EVT_ACTIVE) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Idle) EVT_SWITCH(LVar0) diff --git a/src/battle/common/actor/gloomba.inc.c b/src/battle/common/actor/gloomba.inc.c new file mode 100644 index 0000000000..91abcdeae9 --- /dev/null +++ b/src/battle/common/actor/gloomba.inc.c @@ -0,0 +1,459 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Goomba.h" + +#define NAMESPACE A(gloomba) + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); + +extern s32 N(IdleAnimations)[]; + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 100, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 80, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 100, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 80, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 20 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_GLOOMBA, + .level = 11, + .maxHP = 7, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 70, + .airLiftChance = 90, + .hurricaneChance = 85, + .spookChance = 80, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 24, 24 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_Goomba_Dark_Idle, + STATUS_KEY_STONE, ANIM_Goomba_Dark_Still, + STATUS_KEY_SLEEP, ANIM_Goomba_Dark_Sleep, + STATUS_KEY_POISON, ANIM_Goomba_Dark_Idle, + STATUS_KEY_STOP, ANIM_Goomba_Dark_Still, + STATUS_KEY_STATIC, ANIM_Goomba_Dark_Idle, + STATUS_KEY_PARALYZE, ANIM_Goomba_Dark_Still, + STATUS_KEY_DIZZY, ANIM_Goomba_Dark_Dizzy, + STATUS_KEY_FEAR, ANIM_Goomba_Dark_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_step)[] = { + STATUS_KEY_NORMAL, ANIM_Goomba_Dark_Run, + STATUS_KEY_STONE, ANIM_Goomba_Dark_Still, + STATUS_KEY_SLEEP, ANIM_Goomba_Dark_Sleep, + STATUS_KEY_POISON, ANIM_Goomba_Dark_Idle, + STATUS_KEY_STOP, ANIM_Goomba_Dark_Still, + STATUS_KEY_STATIC, ANIM_Goomba_Dark_Run, + STATUS_KEY_PARALYZE, ANIM_Goomba_Dark_Still, + STATUS_KEY_DIZZY, ANIM_Goomba_Dark_Dizzy, + STATUS_KEY_FEAR, ANIM_Goomba_Dark_Dizzy, + STATUS_END, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_LABEL(10) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_LOOP(80) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_GOTO(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Dizzy) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_STAR_BEAM) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Run) + EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/CalculateArcsinDeg.inc.c" + +EvtScript N(takeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 10) + EVT_ADD(LVar2, 3) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Sleep) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Hurt) + EVT_WAIT(HIT_RESULT_LUCKY) + EVT_IF_EQ(LVarA, 5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_THREAD + EVT_WAIT(4) + EVT_SET(LVar0, 180) + EVT_LOOP(4) + EVT_SUB(LVar0, 45) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Dizzy) + EVT_WAIT(5) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Tense) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_END_SWITCH + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_WAIT(3) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/goomba.inc.c b/src/battle/common/actor/goomba.inc.c index 51f5ebfbf8..e679fb1c1c 100644 --- a/src/battle/common/actor/goomba.inc.c +++ b/src/battle/common/actor/goomba.inc.c @@ -1,8 +1,24 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Goomba.h" +#ifndef NESTED_ACTOR_INCLUDE +#define NAMESPACE A(goomba) +#endif + +enum N(ActorParams) { + DMG_HEADBONK = 1, +}; + +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); + +#ifndef NESTED_ACTOR_INCLUDE + +extern EvtScript N(EVS_Init); +extern s32 N(DefaultAnims)[]; + enum N(ActorPartIDs) { PRT_MAIN = 1, }; @@ -37,9 +53,6 @@ s32 N(StatusTable)[] = { STATUS_END, }; -extern s32 N(IdleAnimations)[]; -extern EvtScript N(init); - ActorPartBlueprint N(ActorParts)[] = { { .flags = ACTOR_PART_FLAG_MULTI_TARGET, @@ -47,7 +60,7 @@ ActorPartBlueprint N(ActorParts)[] = { .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 20 }, .opacity = 255, - .idleAnimations = N(IdleAnimations), + .idleAnimations = N(DefaultAnims), .defenseTable = N(DefenseTable), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, @@ -62,7 +75,7 @@ ActorBlueprint NAMESPACE = { .maxHP = 2, .partCount = ARRAY_COUNT(N(ActorParts)), .partsData = N(ActorParts), - .initScript = &N(init), + .initScript = &N(EVS_Init), .statusTable = N(StatusTable), .escapeChance = 90, .airLiftChance = 100, @@ -78,7 +91,9 @@ ActorBlueprint NAMESPACE = { .statusTextOffset = { 10, 20 }, }; -s32 N(IdleAnimations)[] = { +#endif // NESTED_ACTOR_INCLUDE + +s32 N(DefaultAnims)[] = { STATUS_KEY_NORMAL, ANIM_Goomba_Idle, STATUS_KEY_STONE, ANIM_Goomba_Still, STATUS_KEY_SLEEP, ANIM_Goomba_Sleep, @@ -91,7 +106,8 @@ s32 N(IdleAnimations)[] = { STATUS_END, }; -s32 N(IdleAnimations2)[] = { +// while shuffling around during idle +s32 N(ShuffleAnims)[] = { STATUS_KEY_NORMAL, ANIM_Goomba_Run, STATUS_KEY_STONE, ANIM_Goomba_Still, STATUS_KEY_SLEEP, ANIM_Goomba_Sleep, @@ -104,69 +120,65 @@ s32 N(IdleAnimations2)[] = { STATUS_END, }; -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); - -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) EVT_RETURN EVT_END }; -EvtScript N(idle) = { +EvtScript N(EVS_Idle) = { EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations2))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(ShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations2))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_LOOP(80) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(ShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) + EVT_LOOP(80) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) + EVT_END_LOOP + EVT_GOTO(10) EVT_RETURN EVT_END }; -EvtScript N(handleEvent) = { +EvtScript N(EVS_HandleEvent) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) @@ -174,41 +186,41 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_BurnHurt) EVT_SET_CONST(LVar2, ANIM_Goomba_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_BurnHurt) EVT_SET_CONST(LVar2, ANIM_Goomba_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -223,10 +235,10 @@ EvtScript N(handleEvent) = { EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -234,16 +246,16 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -256,21 +268,21 @@ EvtScript N(handleEvent) = { EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Run) EVT_SET_CONST(LVar2, ANIM_Goomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -285,7 +297,7 @@ EvtScript N(handleEvent) = { #include "common/CalculateArcsinDeg.inc.c" -EvtScript N(takeTurn) = { +EvtScript N(EVS_TakeTurn) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) @@ -416,7 +428,7 @@ EvtScript N(takeTurn) = { EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) EVT_WAIT(1) EVT_END_SWITCH - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_HEADBONK, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_HIT) EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) diff --git a/src/battle/common/actor/gray_magikoopa.inc.c b/src/battle/common/actor/gray_magikoopa.inc.c index 738f2de412..423b4fc222 100644 --- a/src/battle/common/actor/gray_magikoopa.inc.c +++ b/src/battle/common/actor/gray_magikoopa.inc.c @@ -1,10 +1,11 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" #include "sprite/npc/Magikoopa.h" #include "sprite/npc/FlyingMagikoopa.h" +#define NAMESPACE A(gray_magikoopa) + extern EvtScript N(init); extern EvtScript N(init_flying); extern EvtScript N(takeTurn); @@ -230,54 +231,54 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Gray_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Gray_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -291,7 +292,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -303,7 +304,7 @@ EvtScript N(handleEvent) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_MAIN, -4, 5, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -422,13 +423,13 @@ EvtScript N(handleEvent_flying) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(EVENT_HIT) EVT_CASE_OR_EQ(EVENT_FALL_TRIGGER) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(knockOff)) @@ -436,46 +437,46 @@ EvtScript N(handleEvent_flying) = { EVT_CASE_OR_EQ(EVENT_BURN_HIT) EVT_CASE_OR_EQ(EVENT_15) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Gray_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(knockOff)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Gray_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -490,7 +491,7 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_FlyingMagikoopa_Gray_Anim01) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -504,7 +505,7 @@ EvtScript N(handleEvent_flying) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -516,7 +517,7 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, -15, 0, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Gray_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/green_magikoopa.inc.c b/src/battle/common/actor/green_magikoopa.inc.c index db3adebb70..74fb1b4c71 100644 --- a/src/battle/common/actor/green_magikoopa.inc.c +++ b/src/battle/common/actor/green_magikoopa.inc.c @@ -1,11 +1,12 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" #include "sprite/npc/Magikoopa.h" #include "sprite/npc/FlyingMagikoopa.h" +#define NAMESPACE A(green_magikoopa) + extern EvtScript N(init); extern EvtScript N(init_flying); extern EvtScript N(idle); @@ -232,54 +233,54 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Green_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Green_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -293,7 +294,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -305,7 +306,7 @@ EvtScript N(handleEvent) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_MAIN, -4, 5, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -424,13 +425,13 @@ EvtScript N(handleEvent_flying) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(EVENT_HIT) EVT_CASE_OR_EQ(EVENT_FALL_TRIGGER) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(knockOff)) @@ -438,46 +439,46 @@ EvtScript N(handleEvent_flying) = { EVT_CASE_OR_EQ(EVENT_BURN_HIT) EVT_CASE_OR_EQ(EVENT_15) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Green_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(knockOff)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Green_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -492,7 +493,7 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_FlyingMagikoopa_Green_Anim01) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -506,7 +507,7 @@ EvtScript N(handleEvent_flying) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -518,7 +519,7 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, -15, 0, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Green_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/green_shy_guy.inc.c b/src/battle/common/actor/green_shy_guy.inc.c new file mode 100644 index 0000000000..d7b2e1aca7 --- /dev/null +++ b/src/battle/common/actor/green_shy_guy.inc.c @@ -0,0 +1,497 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/ShyGuy.h" + +#define NAMESPACE A(green_shy_guy) + +extern s32 N(IdleAnimations_8021FF1C)[]; +extern EvtScript N(init_8021FF68); +extern EvtScript N(takeTurn_802218B4); +extern EvtScript N(idle_8021FFB4); +extern EvtScript N(handleEvent_80220128); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable_8021FE10)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_SHOCK, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8021FE24)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021FF1C), + .defenseTable = N(DefenseTable_8021FE10), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_SHY_GUY, + .level = 14, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021FF68), + .statusTable = N(StatusTable_8021FE24), + .escapeChance = 60, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 80, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 28, 24 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_8021FF1C)[] = { + STATUS_KEY_NORMAL, ANIM_ShyGuy_Green_Anim01, + STATUS_KEY_STONE, ANIM_ShyGuy_Green_Anim00, + STATUS_KEY_SLEEP, ANIM_ShyGuy_Green_Anim12, + STATUS_KEY_POISON, ANIM_ShyGuy_Green_Anim01, + STATUS_KEY_STOP, ANIM_ShyGuy_Green_Anim00, + STATUS_KEY_STATIC, ANIM_ShyGuy_Green_Anim01, + STATUS_KEY_PARALYZE, ANIM_ShyGuy_Green_Anim00, + STATUS_KEY_DIZZY, ANIM_ShyGuy_Green_Anim13, + STATUS_KEY_FEAR, ANIM_ShyGuy_Green_Anim13, + STATUS_END, +}; + +EvtScript N(init_8021FF68) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_802218B4))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021FFB4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80220128))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_8021FFB4) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(802200C4) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80220128) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Green_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Green_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(802200C4)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim03) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Green_Anim14) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(80220604) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_WAIT(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_END_THREAD + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim05) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) + EVT_WAIT(8) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(802200C4)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(80220D2C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim09) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 80) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim09) + EVT_THREAD + EVT_WAIT(12) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim09) + EVT_THREAD + EVT_WAIT(9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) + EVT_SET(LVar3, 0) + EVT_LOOP(20) + EVT_SUB(LVar3, 30) + EVT_IF_LT(LVar3, 0) + EVT_ADD(LVar3, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim09) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim07) + EVT_WAIT(15) + EVT_GOTO(2) + EVT_LABEL(1) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim10) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 50) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim11) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim13) + EVT_END_IF + EVT_WAIT(25) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_LABEL(2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Green_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Green_Anim01) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_802218B4) = { + EVT_CALL(RandInt, 1, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_EXEC_WAIT(N(80220604)) + EVT_ELSE + EVT_EXEC_WAIT(N(80220D2C)) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/groove_guy.inc.c b/src/battle/common/actor/groove_guy.inc.c new file mode 100644 index 0000000000..ec8a4e9beb --- /dev/null +++ b/src/battle/common/actor/groove_guy.inc.c @@ -0,0 +1,833 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/ShyGuy.h" +#include "sprite/npc/MediGuy.h" +#include "sprite/npc/GrooveGuy.h" + +#define NAMESPACE A(groove_guy) + +extern EvtScript N(init_80224B38); +extern EvtScript N(takeTurn_80226338); +extern EvtScript N(idle_80224B9C); +extern EvtScript N(handleEvent_80224D10); +extern EvtScript N(randomSummon); +extern EvtScript N(80226C00); +extern EvtScript N(80226DEC); +extern EvtScript N(802271A0); +extern Formation N(specialFormation_802273A8); +extern Formation N(specialFormation_802273C4); +extern Formation N(specialFormation_802273E0); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(IdleAnimations_802249E0)[] = { + STATUS_KEY_NORMAL, ANIM_GrooveGuy_Anim01, + STATUS_KEY_STONE, ANIM_GrooveGuy_Anim00, + STATUS_KEY_SLEEP, ANIM_GrooveGuy_Anim06, + STATUS_KEY_POISON, ANIM_GrooveGuy_Anim01, + STATUS_KEY_STOP, ANIM_GrooveGuy_Anim00, + STATUS_KEY_STATIC, ANIM_GrooveGuy_Anim01, + STATUS_KEY_PARALYZE, ANIM_GrooveGuy_Anim00, + STATUS_KEY_DIZZY, ANIM_GrooveGuy_Anim07, + STATUS_KEY_FEAR, ANIM_GrooveGuy_Anim07, + STATUS_END, +}; + +s32 N(DefenseTable_80224A2C)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_SHOCK, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_80224A40)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 80, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +BSS PlayerStatus D_802310D0; + +ActorPartBlueprint N(ActorParts_80224AEC)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_802249E0), + .defenseTable = N(DefenseTable_80224A2C), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_GROOVE_GUY, + .level = 15, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts_80224AEC)), + .partsData = N(ActorParts_80224AEC), + .initScript = &N(init_80224B38), + .statusTable = N(StatusTable_80224A40), + .escapeChance = 50, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 70, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 80, + .coinReward = 2, + .size = { 28, 28 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(init_80224B38) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80226338))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80224B9C))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80224D10))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_80224B9C) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -13, 15, 4, 13) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(80224CAC) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80224D10) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim0E) + EVT_SET_CONST(LVar2, ANIM_GrooveGuy_Anim0F) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim0E) + EVT_SET_CONST(LVar2, ANIM_GrooveGuy_Anim0F) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim0F) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(80224CAC)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim04) + EVT_SET_CONST(LVar2, ANIM_GrooveGuy_Anim11) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_OR_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_GrooveGuy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(basicAttack) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim10) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(80224CAC)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_WAIT(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_END_THREAD + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim10) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim01) + EVT_WAIT(8) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(80224CAC)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(sleepySpin) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim10) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) + EVT_SET(LVar0, 0) + EVT_LOOP(30) + EVT_ADD(LVar0, 48) + EVT_MOD(LVar0, 360) + EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B) + EVT_WAIT(20) + EVT_IF_EQ(LVar0, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(80224CAC)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_STATUS_ALWAYS_HITS, 0, DMG_STATUS_KEY(STATUS_FLAG_DIZZY, 2, 50), 0, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(WasStatusInflicted, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar0, TRUE) + EVT_THREAD + EVT_SET(LVar0, 0) + EVT_LOOP(30) + EVT_ADD(LVar0, 48) + EVT_MOD(LVar0, 360) + EVT_CALL(SetActorYaw, ACTOR_PLAYER, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorYaw, ACTOR_PLAYER, 0) + EVT_END_THREAD + EVT_END_IF + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E3) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B) + EVT_SET(LVar0, 0) + EVT_LOOP(15) + EVT_ADD(LVar0, 24) + EVT_MOD(LVar0, 360) + EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E4) + EVT_THREAD + EVT_SET(LVar0, 0) + EVT_LOOP(20) + EVT_ADD(LVar0, 72) + EVT_MOD(LVar0, 360) + EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorYaw, ACTOR_SELF, LVar0) + EVT_END_THREAD + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0A) + EVT_WAIT(25) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(80224CAC)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(getFirstOpenColumn) = { + EVT_SET(LFlag1, FALSE) + EVT_SET(LFlag2, FALSE) + EVT_SET(LFlag3, FALSE) + EVT_SET(LFlag4, FALSE) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar5) + EVT_CALL(GetIndexFromHome, LVar0, LVar5) + EVT_MOD(LVar5, 4) + EVT_SWITCH(LVar5) + EVT_CASE_EQ(0) + EVT_SET(LFlag1, TRUE) + EVT_CASE_EQ(1) + EVT_SET(LFlag2, TRUE) + EVT_CASE_EQ(2) + EVT_SET(LFlag3, TRUE) + EVT_CASE_EQ(3) + EVT_SET(LFlag4, TRUE) + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_IF_EQ(LFlag1, FALSE) + EVT_SET(LVarA, 0) + EVT_RETURN + EVT_END_IF + EVT_IF_EQ(LFlag2, FALSE) + EVT_SET(LVarA, 1) + EVT_RETURN + EVT_END_IF + EVT_IF_EQ(LFlag3, FALSE) + EVT_SET(LVarA, 2) + EVT_RETURN + EVT_END_IF + EVT_IF_EQ(LFlag4, FALSE) + EVT_SET(LVarA, 3) + EVT_RETURN + EVT_END_IF + EVT_SET(LVarA, -1) + EVT_RETURN + EVT_END +}; + +EvtScript N(countActiveSummoners) = { + EVT_SET(LVar9, 0) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetOriginalActorType, LVar0, LVar2) + EVT_SWITCH(LVar2) + EVT_CASE_EQ(ACTOR_TYPE_GROOVE_GUY) + EVT_CALL(GetStatusFlags, LVar0, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(GetActorVar, LVar0, 0, LVar3) + EVT_IF_NE(LVar3, 2) + EVT_ADD(LVar9, 1) + EVT_END_IF + EVT_END_IF + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_80226338) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 2) + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 60) + EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_DIZZY) + EVT_EXEC_WAIT(N(basicAttack)) + EVT_ELSE + EVT_EXEC_WAIT(N(sleepySpin)) + EVT_END_IF + EVT_ELSE + EVT_EXEC_WAIT(N(basicAttack)) + EVT_END_IF + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(getFirstOpenColumn)) + EVT_IF_EQ(LVarA, -1) + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 60) + EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_DIZZY) + EVT_EXEC_WAIT(N(basicAttack)) + EVT_ELSE + EVT_EXEC_WAIT(N(sleepySpin)) + EVT_END_IF + EVT_ELSE + EVT_EXEC_WAIT(N(basicAttack)) + EVT_END_IF + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(countActiveSummoners)) + EVT_SWITCH(LVar9) + EVT_CASE_EQ(1) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 300) + EVT_EXEC_WAIT(N(randomSummon)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(2) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 150) + EVT_EXEC_WAIT(N(randomSummon)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(3) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 100) + EVT_EXEC_WAIT(N(randomSummon)) + EVT_RETURN + EVT_END_IF + EVT_END_SWITCH + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 60) + EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_DIZZY) + EVT_EXEC_WAIT(N(basicAttack)) + EVT_ELSE + EVT_EXEC_WAIT(N(sleepySpin)) + EVT_END_IF + EVT_ELSE + EVT_EXEC_WAIT(N(basicAttack)) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(randomSummon) = { + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_11) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(RandInt, 2, LVar1) + EVT_SWITCH(LVar1) + EVT_CASE_EQ(0) + EVT_EXEC_WAIT(N(80226C00)) + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(80226DEC)) + EVT_CASE_EQ(2) + EVT_EXEC_WAIT(N(802271A0)) + EVT_END_SWITCH + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_802249E0))) + EVT_RETURN + EVT_END +}; + +s32 func_8021878C_512D5C(Evt* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32 x, y, z; + f32 temp_f20; + s32 temp_v0; + + x = evt_get_variable(script, *args++); + y = evt_get_variable(script, *args++); + z = evt_get_variable(script, *args++); + temp_f20 = evt_get_float_variable(script, *args++); + temp_v0 = evt_get_variable(script, *args++); + + D_802310D0.position.x = x; + D_802310D0.position.y = y; + D_802310D0.position.z = z; + fx_46(6, &D_802310D0, temp_f20, temp_v0); + + return ApiStatus_DONE2; +} + +EvtScript N(8022671C) = { + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) + EVT_WAIT(4) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B) + EVT_WAIT(4) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) + EVT_WAIT(4) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0D) + EVT_WAIT(4) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) + EVT_WAIT(4) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B) + EVT_WAIT(4) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) + EVT_WAIT(4) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0D) + EVT_WAIT(4) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E5) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_SETF(LVar3, EVT_FLOAT(1.0)) + EVT_ELSE + EVT_SETF(LVar3, EVT_FLOAT(0.4)) + EVT_END_IF + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(func_8021878C_512D5C, LVar0, LVar1, LVar2, LVar3, 48) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E6) + EVT_SET(LVar0, 0) + EVT_LOOP(48) + EVT_ADD(LVar0, 30) + EVT_IF_GE(LVar0, 360) + EVT_SUB(LVar0, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, LVar0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 30) + EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, LVar0, LVar1, LVar2, 30, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0A) + EVT_WAIT(8) + EVT_RETURN + EVT_END +}; + +EvtScript N(80226C00) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_EXEC_WAIT(N(8022671C)) + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802273A8)), FALSE) + EVT_SET(LVarB, LVar0) + EVT_SET(LVar0, 200) + EVT_SET(LVar1, 0) + EVT_SET(LVar2, 0) + EVT_CALL(SetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_03) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(SetGoalToIndex, LVarB, LVarA) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, LVarB, 0, FALSE) + EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(HPBarToHome, LVarB) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(80226DEC) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_EXEC_WAIT(N(8022671C)) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_03) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802273C4)), FALSE) + EVT_SET(LVarB, LVar0) + EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_GrooveGuy_Anim0C) + EVT_CALL(SetGoalToIndex, LVarB, LVarA) + EVT_CALL(GetGoalPos, LVarB, LVar3, LVar4, LVar5) + EVT_ADD(LVar3, 200) + EVT_CALL(SetActorPos, LVarB, LVar3, LVar4, LVar5) + EVT_THREAD + EVT_SET(LVar6, 0) + EVT_LOOP(50) + EVT_ADD(LVar6, 30) + EVT_MOD(LVar6, 360) + EVT_CALL(SetActorYaw, LVarB, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorYaw, LVarB, 0) + EVT_END_THREAD + EVT_CALL(SetActorSounds, LVarB, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) + EVT_THREAD + EVT_LOOP(2) + EVT_CALL(PlaySoundAtActor, LVarB, SOUND_2E2) + EVT_WAIT(25) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, LVarB, 0, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20F3) + EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_GrooveGuy_Anim0A) + EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 20) + EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 30, 0) + EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) + EVT_WAIT(25) + EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_GrooveGuy_Anim01) + EVT_CALL(HPBarToHome, LVarB) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, LVarB, 0, 1) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, LVarB, 0, 2) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(802271A0) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_EXEC_WAIT(N(8022671C)) + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_802273E0)), FALSE) + EVT_SET(LVarB, LVar0) + EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_MediGuy_Anim05) + EVT_ADD(LVarA, 4) + EVT_CALL(SetGoalToIndex, LVarB, LVarA) + EVT_CALL(GetGoalPos, LVarB, LVar3, LVar4, LVar5) + EVT_SET(LVar0, 200) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_CALL(SetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSounds, LVarB, ACTOR_SOUND_WALK, SOUND_380, SOUND_0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_03) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, LVarB, 0, FALSE) + EVT_CALL(SetAnimation, LVarB, PRT_MAIN, ANIM_MediGuy_Anim01) + EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(HPBarToHome, LVarB) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +extern ActorBlueprint A(red_shy_guy); +extern ActorBlueprint A(medi_guy); + +Vec3i N(vector3D_8022739C) = { 0, 0xFFFFFC18, 0 }; + +Formation N(specialFormation_802273A8) = { + ACTOR_BY_POS(A(red_shy_guy), N(vector3D_8022739C), 100), +}; + +Formation N(specialFormation_802273C4) = { + ACTOR_BY_POS(NAMESPACE, N(vector3D_8022739C), 100), +}; + +Formation N(specialFormation_802273E0) = { + ACTOR_BY_POS(A(medi_guy), N(vector3D_8022739C), 100), +}; diff --git a/src/battle/common/actor/gulpit.inc.c b/src/battle/common/actor/gulpit.inc.c new file mode 100644 index 0000000000..8fcb21638f --- /dev/null +++ b/src/battle/common/actor/gulpit.inc.c @@ -0,0 +1,495 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "effects.h" +#include "sprite/npc/Gulpit.h" + +#define NAMESPACE A(gulpit) + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, +}; + +s32 N(IdleAnimations1)[] = { + STATUS_KEY_NORMAL, ANIM_Gulpit_Anim01, + STATUS_KEY_STONE, ANIM_Gulpit_Anim00, + STATUS_KEY_SLEEP, ANIM_Gulpit_Anim0F, + STATUS_KEY_POISON, ANIM_Gulpit_Anim01, + STATUS_KEY_STOP, ANIM_Gulpit_Anim00, + STATUS_KEY_STATIC, ANIM_Gulpit_Anim01, + STATUS_KEY_PARALYZE, ANIM_Gulpit_Anim00, + STATUS_KEY_DIZZY, ANIM_Gulpit_Anim0E, + STATUS_KEY_FEAR, ANIM_Gulpit_Anim0E, + STATUS_END, +}; + +s32 N(IdleAnimations2)[] = { + STATUS_KEY_NORMAL, ANIM_Gulpit_Anim10, + STATUS_END, +}; + +s32 N(IdleAnimations3)[] = { + STATUS_KEY_NORMAL, ANIM_Gulpit_Anim12, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 60, + STATUS_KEY_POISON, 80, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 10, + STATUS_KEY_PARALYZE, 80, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 85, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -7, 48 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations1), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -3, -23 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations2), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations3), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_GULPIT, + .level = 22, + .maxHP = 12, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 60, + .airLiftChance = 50, + .hurricaneChance = 50, + .spookChance = 70, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 53, 50 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -3, 37 }, + .statusTextOffset = { 10, 45 }, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(returnHome) = { + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0C) + EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim0D) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0C) + EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim0D) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0D) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim03) + EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(attack_lick) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 80) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim03) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(AddGoalPos, ACTOR_SELF, 10, 0, 0) + EVT_ELSE + EVT_CALL(AddGoalPos, ACTOR_SELF, 20, 0, 0) + EVT_END_IF + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim01) + EVT_WAIT(10) + EVT_THREAD + EVT_WAIT(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EE) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim04) + EVT_WAIT(9) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_WAIT(10) + EVT_CALL(YieldTurn) + EVT_EXEC_WAIT(N(returnHome)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(attack_rock) = { + EVT_SET(LVarA, LVar0) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(GetActorPos, LVarA, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_SUB(LVar2, 1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim02) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim01) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20EE) + EVT_CALL(GetActorVar, LVarA, 0, LVar0) + EVT_SET(LVarB, LVar0) + EVT_SWITCH(LVarB) + EVT_CASE_EQ(0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim05) + EVT_WAIT(3) + EVT_CALL(RemoveActor, LVarA) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim06) + EVT_WAIT(15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim07) + EVT_SET(LVarA, 2) + EVT_CASE_EQ(1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim08) + EVT_WAIT(3) + EVT_CALL(RemoveActor, LVarA) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim09) + EVT_WAIT(15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim0A) + EVT_SET(LVarA, 3) + EVT_END_SWITCH + EVT_CALL(SetPartSounds, ACTOR_SELF, LVarA, ACTOR_SOUND_JUMP, 985, 0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVar9, LVar0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVarA, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 20) + EVT_ADD(LVar2, 2) + EVT_CALL(SetPartPos, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, -100, 0, 5) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, LVarA, EVT_FLOAT(14.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, LVarA, EVT_FLOAT(0.01)) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpPartTo, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2, 0, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVarA, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_IF_EQ(LVar9, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(15) + EVT_CALL(YieldTurn) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVarA, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 20) + EVT_ADD(LVar2, 2) + EVT_CALL(SetPartPos, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, LVarA, EVT_FLOAT(14.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, LVarA, EVT_FLOAT(0.01)) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpPartTo, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2, 0, TRUE) + EVT_SWITCH(LVarA) + EVT_CASE_EQ(2) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 7, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CASE_EQ(3) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 5, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_END_SWITCH + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim01) + EVT_CALL(GetPartOffset, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, -100) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, LVarA, EVT_FLOAT(1.0)) + EVT_CALL(JumpPartTo, ACTOR_SELF, LVarA, LVar0, LVar1, LVar2, 25, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVarA, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_WAIT(10) + EVT_CALL(YieldTurn) + EVT_EXEC_WAIT(N(returnHome)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_EXEC_WAIT(N(attack_lick)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_EXEC_WAIT(N(attack_lick)) + EVT_RETURN + EVT_END_IF + EVT_SET(LVarA, 0) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_10000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetOriginalActorType, LVar0, LVar2) + EVT_IF_EQ(LVar2, ACTOR_TYPE_GULPIT_ROCKS) + EVT_ADD(LVarA, 1) + EVT_SWITCH(LVarA) + EVT_CASE_EQ(1) + EVT_SET(LVarB, LVar0) + EVT_CASE_EQ(2) + EVT_SET(LVarC, LVar0) + EVT_CASE_EQ(3) + EVT_SET(LVarD, LVar0) + EVT_END_SWITCH + EVT_END_IF + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_SWITCH(LVarA) + EVT_CASE_EQ(0) + EVT_EXEC_WAIT(N(attack_lick)) + EVT_CASE_EQ(1) + EVT_SET(LVar0, LVarB) + EVT_EXEC_WAIT(N(attack_rock)) + EVT_CASE_EQ(2) + EVT_CALL(RandInt, 1, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_SET(LVar0, LVarB) + EVT_CASE_EQ(1) + EVT_SET(LVar0, LVarC) + EVT_END_SWITCH + EVT_EXEC_WAIT(N(attack_rock)) + EVT_CASE_GE(3) + EVT_CALL(RandInt, 2, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_SET(LVar0, LVarB) + EVT_CASE_EQ(1) + EVT_SET(LVar0, LVarC) + EVT_CASE_EQ(2) + EVT_SET(LVar0, LVarD) + EVT_END_SWITCH + EVT_EXEC_WAIT(N(attack_rock)) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + diff --git a/src/battle/common/actor/gulpit_rocks.inc.c b/src/battle/common/actor/gulpit_rocks.inc.c new file mode 100644 index 0000000000..7698473a51 --- /dev/null +++ b/src/battle/common/actor/gulpit_rocks.inc.c @@ -0,0 +1,189 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "effects.h" +#include "sprite/npc/Gulpit.h" + +#define NAMESPACE A(gulpit_rocks) + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_Gulpit_Anim10, + STATUS_END, +}; + +s32 N(IdleAnimations2)[] = { + STATUS_KEY_NORMAL, ANIM_Gulpit_Anim12, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 0, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 0, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 0, + STATUS_KEY_SHRINK, 0, + STATUS_KEY_STOP, 0, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 14 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -6 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_NO_SHADOW | ACTOR_FLAG_TARGET_ONLY | ACTOR_FLAG_NO_HEALTH_BAR | ACTOR_FLAG_NO_ATTACK, + .type = ACTOR_TYPE_GULPIT_ROCKS, + .level = 0, + .maxHP = 1, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 0, + .airLiftChance = 100, + .hurricaneChance = 0, + .spookChance = 0, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 0, + .size = { 32, 18 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim10) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetActorSize, ACTOR_SELF, 24, 15) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations2))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim12) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, 1) + EVT_CALL(SetActorSize, ACTOR_SELF, 10, 8) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(setAnim) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_SWITCH(LVarA) + EVT_CASE_EQ(0) + EVT_CASE_EQ(1) + EVT_SET_CONST(LVar1, LVar2) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_CASE_OR_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim10) + EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim12) + EVT_EXEC_WAIT(N(setAnim)) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim10) + EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim12) + EVT_EXEC_WAIT(N(setAnim)) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_OR_EQ(EVENT_BURN_DEATH) + EVT_CASE_OR_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Gulpit_Anim10) + EVT_SET_CONST(LVar2, ANIM_Gulpit_Anim12) + EVT_EXEC_WAIT(N(setAnim)) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim11) + EVT_CASE_EQ(1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim13) + EVT_END_SWITCH + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 1, LVar0, LVar1, LVar2, 0, 0) + EVT_WAIT(30) + EVT_CALL(RemoveActor, ACTOR_SELF) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_RETURN + EVT_END +}; + diff --git a/src/battle/common/actor/hammer_bro.inc.c b/src/battle/common/actor/hammer_bro.inc.c index f762f2cfaf..af84546793 100644 --- a/src/battle/common/actor/hammer_bro.inc.c +++ b/src/battle/common/actor/hammer_bro.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/HammerBros.h" +#define NAMESPACE A(hammer_bro) + extern EvtScript N(init); extern EvtScript N(takeTurn); extern EvtScript N(idle); @@ -203,39 +204,39 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim0F) EVT_SET_CONST(LVar2, ANIM_HammerBros_Anim10) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim0F) EVT_SET_CONST(LVar2, ANIM_HammerBros_Anim10) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim10) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim15) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) @@ -245,26 +246,26 @@ EvtScript N(handleEvent) = { EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim02) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim07) EVT_SET_CONST(LVar2, ANIM_HammerBros_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim07) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -276,12 +277,12 @@ EvtScript N(handleEvent) = { EVT_CALL(SetActorDispOffset, ACTOR_SELF, -5, 3, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_HammerBros_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_DEFAULT diff --git a/src/battle/common/actor/hurt_plant.inc.c b/src/battle/common/actor/hurt_plant.inc.c new file mode 100644 index 0000000000..7efa6489aa --- /dev/null +++ b/src/battle/common/actor/hurt_plant.inc.c @@ -0,0 +1,351 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/HurtPlant.h" + +#define NAMESPACE A(hurt_plant) + +extern EvtScript N(init_8021DA98); +extern EvtScript N(takeTurn_8021E33C); +extern EvtScript N(idle_8021DAE4); +extern EvtScript N(handleEvent_8021DCF4); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(IdleAnimations_8021D940)[] = { + STATUS_KEY_NORMAL, ANIM_HurtPlant_Anim02, + STATUS_KEY_STONE, ANIM_HurtPlant_Anim00, + STATUS_KEY_SLEEP, ANIM_HurtPlant_Anim0C, + STATUS_KEY_POISON, ANIM_HurtPlant_Anim02, + STATUS_KEY_STOP, ANIM_HurtPlant_Anim00, + STATUS_KEY_STATIC, ANIM_HurtPlant_Anim02, + STATUS_KEY_PARALYZE, ANIM_HurtPlant_Anim00, + STATUS_KEY_DIZZY, ANIM_HurtPlant_Anim09, + STATUS_KEY_FEAR, ANIM_HurtPlant_Anim09, + STATUS_END, +}; + +s32 N(DefenseTable_8021D98C)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_FIRE, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8021D9A0)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 95, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -10, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021D940), + .defenseTable = N(DefenseTable_8021D98C), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -8, -5 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_HURT_PLANT, + .level = 16, + .maxHP = 8, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021DA98), + .statusTable = N(StatusTable_8021D9A0), + .escapeChance = 70, + .airLiftChance = 20, + .hurricaneChance = 20, + .spookChance = 70, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 95, + .coinReward = 1, + .size = { 40, 35 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -18, 23 }, + .statusTextOffset = { 1, 20 }, +}; + +EvtScript N(init_8021DA98) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021E33C))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021DAE4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021DCF4))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_8021DAE4) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_FLAG(STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -6, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -2, -5) + EVT_CALL(N(SetAbsoluteStatusOffsets), -20, 8, 0, 14) + EVT_CASE_DEFAULT + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -10, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -8, -5) + EVT_CALL(N(SetAbsoluteStatusOffsets), -18, 23, 1, 20) + EVT_END_SWITCH + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021DBFC) = { + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim04) + EVT_WAIT(10) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim03) + EVT_WAIT(10) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021DCF4) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) + EVT_WAIT(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0A) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0A) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0A) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) + EVT_WAIT(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) + EVT_WAIT(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) + EVT_WAIT(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8021DBFC)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) + EVT_WAIT(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) + EVT_WAIT(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim0D) + EVT_WAIT(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim04) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_WAIT(20) + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(RemoveActor, ACTOR_SELF) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_HurtPlant_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021E33C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim04) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 1) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 27) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_WAIT(15) + EVT_GOTO(123) + EVT_END_IF + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim04) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_WAIT(8) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 27) + EVT_SET(LVar1, 0) + EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) + EVT_CALL(SetBattleCamZoom, 350) + EVT_CALL(SetBattleCamOffsetZ, 45) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 27) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_LABEL(123) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim03) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim05) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2C4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim06) + EVT_WAIT(6) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim07) + EVT_WAIT(5) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8021DBFC)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_POISON) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_ELSE + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 100), 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_END_IF + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HurtPlant_Anim07) + EVT_WAIT(5) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(8021DBFC)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/hyper_cleft.inc.c b/src/battle/common/actor/hyper_cleft.inc.c new file mode 100644 index 0000000000..aa49fd453a --- /dev/null +++ b/src/battle/common/actor/hyper_cleft.inc.c @@ -0,0 +1,842 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Cleft.h" + +#define NAMESPACE A(hyper_cleft) + +extern s32 N(IdleAnimations_80221CD4)[]; +extern EvtScript N(EVS_Init); +extern EvtScript N(idle_80221DD0); +extern EvtScript N(handleEvent_80222140); +extern EvtScript N(takeTurn_80221A58); +extern EvtScript N(takeTurn_80223B5C); +extern EvtScript N(nextTurn_80220D3C); +extern EvtScript N(80222F1C); +extern EvtScript N(80223310); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable_80220B40)[] = { + ELEMENT_NORMAL, 3, + ELEMENT_FIRE, 99, + ELEMENT_END, +}; + +s32 N(DefenseTable_80220B54)[] = { + ELEMENT_NORMAL, 1, + ELEMENT_FIRE, 99, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 40, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 50, + STATUS_KEY_SHRINK, 90, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 22 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80221CD4), + .defenseTable = N(DefenseTable_80220B40), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_HYPER_CLEFT, + .level = 15, + .maxHP = 4, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), + .escapeChance = 70, + .airLiftChance = 30, + .hurricaneChance = 30, + .spookChance = 30, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 95, + .coinReward = 2, + .size = { 44, 36 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_80220C60)[] = { + STATUS_KEY_NORMAL, ANIM_Cleft_Hyper_Anim04, + STATUS_KEY_STONE, ANIM_Cleft_Hyper_Anim00, + STATUS_KEY_SLEEP, ANIM_Cleft_Hyper_Anim0C, + STATUS_KEY_POISON, ANIM_Cleft_Hyper_Anim04, + STATUS_KEY_STOP, ANIM_Cleft_Hyper_Anim00, + STATUS_KEY_STATIC, ANIM_Cleft_Hyper_Anim04, + STATUS_KEY_PARALYZE, ANIM_Cleft_Hyper_Anim00, + STATUS_KEY_DIZZY, ANIM_Cleft_Hyper_Anim0E, + STATUS_KEY_FEAR, ANIM_Cleft_Hyper_Anim0E, + STATUS_END, +}; + +EvtScript N(EVS_Init) = { + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80221DD0))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80222140))) + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80221A58))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_80220D3C))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(nextTurn_80220D3C) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(PHASE_PLAYER_BEGIN) + EVT_CASE_EQ(PHASE_ENEMY_BEGIN) + EVT_CASE_EQ(PHASE_ENEMY_END) + EVT_CALL(SetBattleVar, 1, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 1) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +#include "common/StartRumbleWithParams.inc.c" + +EvtScript N(80220DC0) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_WAIT(20) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_POWER_UP) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 10) + EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 6, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 45, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim04) + EVT_WAIT(30) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 200, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.5)) + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2D9) + EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 4, LVar0, LVar1, LVar2, 0, 0) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) + EVT_END_THREAD + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 2) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220C60))) + EVT_CALL(EnableActorGlow, ACTOR_SELF, TRUE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, TRUE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 30) + EVT_LOOP(20) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 1, 0, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, -1, 0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2DA) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_THREAD + EVT_LOOP(0) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_IF_GT(LVar0, LVar3) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_END_THREAD + EVT_THREAD + EVT_LOOP(30) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2, 0, 0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, -200, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_WAIT(15) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(YieldTurn) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetActorPos, ACTOR_SELF, 300, 0, 0) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_LOOP(25) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2, 0, 0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(12.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 8, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, 0) + EVT_LOOP(60) + EVT_ADD(LVar0, 18) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 50) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 30, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_WAIT(20) + EVT_CALL(YieldTurn) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_80221A58) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetBattleVar, 1, 1) + EVT_EXEC_WAIT(N(80223310)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_EXEC_WAIT(N(80222F1C)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 2) + EVT_EXEC_WAIT(N(80220DC0)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetBattleVar, 1, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 750) + EVT_CALL(SetBattleVar, 1, 2) + EVT_EXEC_WAIT(N(80220DC0)) + EVT_ELSE + EVT_CALL(SetBattleVar, 1, 1) + EVT_EXEC_WAIT(N(80223310)) + EVT_END_IF + EVT_ELSE + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 500) + EVT_CALL(SetBattleVar, 1, 2) + EVT_EXEC_WAIT(N(80220DC0)) + EVT_ELSE + EVT_CALL(SetBattleVar, 1, 1) + EVT_EXEC_WAIT(N(80223310)) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(80223310)) + EVT_RETURN + EVT_CASE_EQ(2) + EVT_EXEC_WAIT(N(80220DC0)) + EVT_RETURN + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +s32 N(IdleAnimations_80221CD4)[] = { + STATUS_KEY_NORMAL, ANIM_Cleft_Hyper_Anim02, + STATUS_KEY_STONE, ANIM_Cleft_Hyper_Anim00, + STATUS_KEY_SLEEP, ANIM_Cleft_Hyper_Anim0C, + STATUS_KEY_POISON, ANIM_Cleft_Hyper_Anim02, + STATUS_KEY_STOP, ANIM_Cleft_Hyper_Anim00, + STATUS_KEY_STATIC, ANIM_Cleft_Hyper_Anim02, + STATUS_KEY_PARALYZE, ANIM_Cleft_Hyper_Anim00, + STATUS_KEY_DIZZY, ANIM_Cleft_Hyper_Anim0E, + STATUS_KEY_FEAR, ANIM_Cleft_Hyper_Anim0E, + STATUS_END, +}; + +s32 N(IdleAnimations_80221D20)[] = { + STATUS_KEY_NORMAL, ANIM_Cleft_Hyper_Anim05, + STATUS_KEY_STONE, ANIM_Cleft_Hyper_Anim01, + STATUS_KEY_SLEEP, ANIM_Cleft_Hyper_Anim0D, + STATUS_KEY_POISON, ANIM_Cleft_Hyper_Anim05, + STATUS_KEY_STOP, ANIM_Cleft_Hyper_Anim01, + STATUS_KEY_STATIC, ANIM_Cleft_Hyper_Anim05, + STATUS_KEY_PARALYZE, ANIM_Cleft_Hyper_Anim01, + STATUS_KEY_DIZZY, ANIM_Cleft_Hyper_Anim0F, + STATUS_KEY_FEAR, ANIM_Cleft_Hyper_Anim0F, + STATUS_END, +}; + +EvtScript N(80221D6C) = { + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80221DD0))) + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80223B5C))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80222140))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_80221DD0) = { + EVT_RETURN + EVT_END +}; + +#include "common/SetSpinSmashable.inc.c" + +EvtScript N(80221DE0) = { + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_THREAD + EVT_SET(LVar0, 0) + EVT_LOOP(5) + EVT_ADD(LVar0, -36) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) + EVT_SUB(LVar1, 6) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 200, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) + EVT_END_THREAD + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 40, 8, EVT_FLOAT(0.0), 20, 0) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim03) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221D20))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_80220B54))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -7) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) + EVT_CALL(N(SetSpinSmashable), 0) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80222140) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_CALL(GetLastElement, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_FLAG(DAMAGE_TYPE_BLAST) + EVT_EXEC_WAIT(N(80221DE0)) + EVT_CASE_DEFAULT + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_SWITCH + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_CALL(GetLastElement, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_FLAG(DAMAGE_TYPE_BLAST) + EVT_EXEC_WAIT(N(80221DE0)) + EVT_CASE_DEFAULT + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_END_IF + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE) + EVT_END_SWITCH + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_STAR_BEAM) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 2) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim03) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim02) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CASE_EQ(EVENT_SPIKE_TAUNT) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim18) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, -3) + EVT_ADD(LVar1, 10) + EVT_ELSE + EVT_ADD(LVar0, -8) + EVT_ADD(LVar1, 27) + EVT_END_IF + EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) + EVT_WAIT(20) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim03) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim02) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_END_IF + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim07) + EVT_SET_CONST(LVar2, ANIM_Cleft_Hyper_Anim08) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim0F) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim0F) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Cleft_Hyper_Anim08) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(80222F1C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(3.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim03) + EVT_WAIT(20) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim05) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_IF_GT(LVar0, 0) + EVT_SUB(LVar0, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, LVar0) + EVT_ELSE + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim03) + EVT_THREAD + EVT_WAIT(3) + EVT_LOOP(5) + EVT_ADD(LVar0, 36) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar1, 6) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 200, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(1.0)) + EVT_END_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80221CD4))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_80220B40))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 22) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) + EVT_WAIT(1) + EVT_CALL(N(SetSpinSmashable), 1) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) + EVT_END_IF + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(80223310) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 30) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(10) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_WAIT(5) + EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim10) + EVT_WAIT(10) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, -5) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim00) + EVT_WAIT(8) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20D1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_THREAD + EVT_WAIT(10) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_THREAD + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 100) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 45) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim08) + EVT_WAIT(15) + EVT_WAIT(8) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim11) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 15) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.4)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim07) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Hyper_Anim02) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_80223B5C) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_EXEC_WAIT(N(80222F1C)) + EVT_ELSE + EVT_EXEC_WAIT(N(80223310)) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/battle/area/arn/actor/hypergoomba.c b/src/battle/common/actor/hyper_goomba.inc.c similarity index 97% rename from src/battle/area/arn/actor/hypergoomba.c rename to src/battle/common/actor/hyper_goomba.inc.c index aa1b52933e..555ff6f803 100644 --- a/src/battle/area/arn/actor/hypergoomba.c +++ b/src/battle/common/actor/hyper_goomba.inc.c @@ -1,10 +1,8 @@ -#include "common.h" -#include "effects.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Goomba.h" -#define NAMESPACE b_area_arn_hypergoomba +#define NAMESPACE A(hyper_goomba) extern s32 N(IdleAnimations_80219818)[]; extern EvtScript N(init_802188C0); @@ -421,33 +419,33 @@ EvtScript N(handleEvent_80219BD8) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_BurnHurt) EVT_SET_CONST(LVar2, ANIM_Goomba_Hyper_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_BurnHurt) EVT_SET_CONST(LVar2, ANIM_Goomba_Hyper_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -458,10 +456,10 @@ EvtScript N(handleEvent_80219BD8) = { EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80219818))) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -482,10 +480,10 @@ EvtScript N(handleEvent_80219BD8) = { EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80219818))) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -499,22 +497,22 @@ EvtScript N(handleEvent_80219BD8) = { EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80219818))) EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Dead) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -527,21 +525,21 @@ EvtScript N(handleEvent_80219BD8) = { EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Run) EVT_SET_CONST(LVar2, ANIM_Goomba_Hyper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/hyper_paragoomba.inc.c b/src/battle/common/actor/hyper_paragoomba.inc.c new file mode 100644 index 0000000000..56e0348274 --- /dev/null +++ b/src/battle/common/actor/hyper_paragoomba.inc.c @@ -0,0 +1,1496 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Goomba.h" +#include "sprite/npc/Paragoomba.h" + +#define NAMESPACE A(hyper_paragoomba) + +extern s32 N(IdleAnimations_8021C594)[]; +extern s32 N(IdleAnimations_8021C62C)[]; +extern s32 N(IdleAnimations_8021C638)[]; +extern s32 N(IdleAnimations_8021F05C)[]; +extern EvtScript N(init_8021B564); +extern EvtScript N(idle_8021C690); +extern EvtScript N(handleEvent_8021C9C4); +extern EvtScript N(nextTurn_8021B5F4); +extern EvtScript N(takeTurn_8021C36C); +extern EvtScript N(takeTurn_8021D1DC); +extern EvtScript N(8021C94C); +extern EvtScript N(8021D9F4); +extern EvtScript N(8021E058); +extern EvtScript N(idle_8021F140); +extern EvtScript N(handleEvent_8021F41C); +extern EvtScript N(takeTurn_8021EE34); +extern EvtScript N(takeTurn_8021FE6C); +extern EvtScript N(nextTurn_8021E194); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, + PRT_4 = 4, +}; + +s32 N(DefenseTable_8021B2F0)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(DefenseTable_8021B2FC)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8021B308)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 80, + STATUS_KEY_POISON, 100, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 80, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 100, + STATUS_KEY_PARALYZE, 100, + STATUS_KEY_SHRINK, 80, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +s32 N(StatusTable_8021B3B4)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 80, + STATUS_KEY_POISON, 80, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 80, + STATUS_KEY_PARALYZE, 100, + STATUS_KEY_SHRINK, 80, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 22 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021F05C), + .defenseTable = N(DefenseTable_8021B2F0), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021C594), + .defenseTable = N(DefenseTable_8021B2FC), + .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -16, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021C62C), + .defenseTable = N(DefenseTable_8021B2F0), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_4, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -16, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021C638), + .defenseTable = N(DefenseTable_8021B2F0), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_HYPER_PARAGOOMBA, + .level = 12, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021B564), + .statusTable = N(StatusTable_8021B3B4), + .escapeChance = 50, + .airLiftChance = 95, + .hurricaneChance = 95, + .spookChance = 80, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 90, + .coinReward = 1, + .size = { 36, 26 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_8021B518)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_Miss, + STATUS_KEY_STONE, ANIM_Paragoomba_Hyper_Still, + STATUS_KEY_SLEEP, ANIM_Paragoomba_Hyper_Sleep, + STATUS_KEY_POISON, ANIM_Paragoomba_Hyper_Miss, + STATUS_KEY_STOP, ANIM_Paragoomba_Hyper_Still, + STATUS_KEY_STATIC, ANIM_Paragoomba_Hyper_Miss, + STATUS_KEY_PARALYZE, ANIM_Paragoomba_Hyper_Still, + STATUS_KEY_DIZZY, ANIM_Paragoomba_Hyper_Dizzy, + STATUS_KEY_FEAR, ANIM_Paragoomba_Hyper_Dizzy, + STATUS_END, +}; + +EvtScript N(init_8021B564) = { + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C690))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C9C4))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_8021B5F4))) + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021C36C))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(nextTurn_8021B5F4) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(PHASE_PLAYER_BEGIN) + EVT_CASE_EQ(PHASE_ENEMY_BEGIN) + EVT_CASE_EQ(PHASE_ENEMY_END) + EVT_CALL(SetBattleVar, 1, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(8021B678) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_WAIT(20) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_POWER_UP) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 10) + EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 6, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 45, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Miss) + EVT_WAIT(30) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, FALSE, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021B518))) + EVT_CALL(EnableActorGlow, ACTOR_SELF, TRUE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, TRUE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 30) + EVT_LOOP(20) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 1, 0, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, -1, 0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -60) + EVT_THREAD + EVT_SET(LVar0, -60) + EVT_LOOP(60) + EVT_ADD(LVar0, 19) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(15.0)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, FALSE, FALSE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, -60, 0, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.3)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(AddGoalPos, ACTOR_SELF, -200, 0, 0) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_WAIT(20) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_THREAD + EVT_SET(LVar0, 0) + EVT_LOOP(30) + EVT_ADD(LVar0, 24) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(SetActorPos, ACTOR_SELF, 300, 0, 0) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Idle) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, -70) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(15.0)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, FALSE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 8, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SET(LVar0, -70) + EVT_LOOP(60) + EVT_ADD(LVar0, 18) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_SUB(LVar0, 70) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, FALSE, FALSE) + EVT_SUB(LVar0, 60) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, FALSE, FALSE) + EVT_WAIT(20) + EVT_CALL(YieldTurn) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) + EVT_EXEC_WAIT(N(8021C94C)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021C36C) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetBattleVar, 1, 1) + EVT_EXEC_WAIT(N(takeTurn_8021D1DC)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_EXEC_WAIT(N(8021B678)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetBattleVar, 1, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 750) + EVT_CALL(SetBattleVar, 1, 2) + EVT_EXEC_WAIT(N(8021B678)) + EVT_ELSE + EVT_CALL(SetBattleVar, 1, 1) + EVT_EXEC_WAIT(N(takeTurn_8021D1DC)) + EVT_END_IF + EVT_ELSE + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 500) + EVT_CALL(SetBattleVar, 1, 2) + EVT_EXEC_WAIT(N(8021B678)) + EVT_ELSE + EVT_CALL(SetBattleVar, 1, 1) + EVT_EXEC_WAIT(N(takeTurn_8021D1DC)) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(takeTurn_8021D1DC)) + EVT_CASE_EQ(2) + EVT_EXEC_WAIT(N(8021B678)) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +s32 N(IdleAnimations_8021C594)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_Idle, + STATUS_KEY_STONE, ANIM_Paragoomba_Hyper_Still, + STATUS_KEY_SLEEP, ANIM_Paragoomba_Hyper_Sleep, + STATUS_KEY_POISON, ANIM_Paragoomba_Hyper_Idle, + STATUS_KEY_STOP, ANIM_Paragoomba_Hyper_Still, + STATUS_KEY_STATIC, ANIM_Paragoomba_Hyper_Idle, + STATUS_KEY_PARALYZE, ANIM_Paragoomba_Hyper_Still, + STATUS_KEY_DIZZY, ANIM_Paragoomba_Hyper_Dizzy, + STATUS_KEY_FEAR, ANIM_Paragoomba_Hyper_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_8021C5E0)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_Run, + STATUS_KEY_STONE, ANIM_Paragoomba_Hyper_Still, + STATUS_KEY_SLEEP, ANIM_Paragoomba_Hyper_Sleep, + STATUS_KEY_POISON, ANIM_Paragoomba_Hyper_Idle, + STATUS_KEY_STOP, ANIM_Paragoomba_Hyper_Still, + STATUS_KEY_STATIC, ANIM_Paragoomba_Hyper_Run, + STATUS_KEY_PARALYZE, ANIM_Paragoomba_Hyper_Still, + STATUS_KEY_DIZZY, ANIM_Paragoomba_Hyper_Dizzy, + STATUS_KEY_FEAR, ANIM_Paragoomba_Hyper_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_8021C62C)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_LWingStill, + STATUS_END, +}; + +s32 N(IdleAnimations_8021C638)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Hyper_RWingStill, + STATUS_END, +}; + +EvtScript N(8021C644) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021D1DC))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C690))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C9C4))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_8021C690) = { + EVT_LABEL(10) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C5E0))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) + EVT_LOOP(40) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_GOTO(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021C94C) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Idle) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021C9C4) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(GetEncounterTrigger, LVar0) + EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) + EVT_EXEC_WAIT(N(8021D9F4)) + EVT_END_IF + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hyper_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hyper_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_FALL_TRIGGER) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_EXEC_WAIT(N(8021D9F4)) + EVT_CASE_EQ(EVENT_15) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hyper_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_EXEC_WAIT(N(8021D9F4)) + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dizzy) + EVT_EXEC_WAIT(N(8021C94C)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_STAR_BEAM) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021C594))) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) + EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) + EVT_CALL(HPBarToCurrent, ACTOR_SELF) + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) + EVT_EXEC_WAIT(N(8021C94C)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Run) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021D1DC) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_LINEAR) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) + EVT_CALL(SetBattleCamZoom, 300) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dive) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_SUB(LVar0, 80) + EVT_SET(LVar1, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dive) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) + EVT_THREAD + EVT_LOOP(4) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DF) + EVT_WAIT(4) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Miss) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(3.0)) + EVT_WAIT(10) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_EXEC_WAIT(N(8021C94C)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) + EVT_CALL(SetBattleCamZoom, 300) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dive) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Dive) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) + EVT_END_SWITCH + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Hyper_Run) + EVT_EXEC_WAIT(N(8021C94C)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/StartRumbleWithParams.inc.c" + +EvtScript N(8021D9F4) = { + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_3, -9, 7, -2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_4, 11, 7, -2) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar0, EVENT_15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_BurnStill) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Hurt) + EVT_END_IF + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 100, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) + EVT_END_THREAD + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar3) + EVT_IF_EQ(LVar3, EVENT_15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Hurt) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_ADD(LVar4, 10) + EVT_ADD(LVar5, 5) + EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar3, LVar4, LVar5, EVT_FLOAT(1.0), 10, 0) + EVT_END_IF + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_LOOP(10) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_WAIT(1) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) + EVT_MOD(LVar0, 4) + EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_8021B308))) + EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_HYPER_GOOMBA) + EVT_EXEC_WAIT(N(8021E058)) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_RETURN + EVT_END +}; + +s32 N(IdleAnimations_8021DF7C)[] = { + STATUS_KEY_NORMAL, ANIM_Goomba_Hyper_Sleep, + STATUS_KEY_STONE, ANIM_Goomba_Hyper_Still, + STATUS_KEY_SLEEP, ANIM_Goomba_Hyper_Sleep, + STATUS_KEY_POISON, ANIM_Goomba_Hyper_Sleep, + STATUS_KEY_STOP, ANIM_Goomba_Hyper_Still, + STATUS_KEY_STATIC, ANIM_Goomba_Hyper_Sleep, + STATUS_KEY_PARALYZE, ANIM_Goomba_Hyper_Still, + STATUS_KEY_DIZZY, ANIM_Goomba_Hyper_Dizzy, + STATUS_KEY_FEAR, ANIM_Goomba_Hyper_Dizzy, + STATUS_END, +}; + +EvtScript N(8021DFC8) = { + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021F140))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021F41C))) + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021EE34))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_8021E194))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021E058) = { + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021F140))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021F41C))) + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021EE34))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_8021E194))) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, TRUE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_END_SWITCH + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, LVar0) + EVT_RETURN + EVT_END +}; + +EvtScript N(nextTurn_8021E194) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(PHASE_PLAYER_BEGIN) + EVT_CASE_EQ(PHASE_ENEMY_BEGIN) + EVT_CASE_EQ(PHASE_ENEMY_END) + EVT_CALL(SetBattleVar, 1, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(8021E218) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_WAIT(20) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_POWER_UP) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 10) + EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 6, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 45, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) + EVT_WAIT(30) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, 0, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DD) + EVT_CALL(N(StartRumbleWithParams), 128, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.5)) + EVT_END_THREAD + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021DF7C))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_CALL(EnableActorGlow, ACTOR_SELF, TRUE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, TRUE) + EVT_WAIT(2) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_IF + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_LOOP(20) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 1, 0, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, -1, 0, 0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_THREAD + EVT_LOOP(0) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_IF_GT(LVar0, LVar3) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_END_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 80) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_10F, 0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, -200, 0, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(15.0)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) + EVT_WAIT(20) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorPos, ACTOR_SELF, 300, 0, 0) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_10F, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 80) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.01)) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(15.0)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 8, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) + EVT_SET(LVar0, 80) + EVT_LOOP(60) + EVT_ADD(LVar0, 18) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_SUB(LVar0, 50) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 30, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_WAIT(10) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021EE34) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetBattleVar, 1, 1) + EVT_EXEC_WAIT(N(takeTurn_8021FE6C)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_EXEC_WAIT(N(8021E218)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetBattleVar, 1, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 750) + EVT_CALL(SetBattleVar, 1, 2) + EVT_EXEC_WAIT(N(8021E218)) + EVT_ELSE + EVT_CALL(SetBattleVar, 1, 1) + EVT_EXEC_WAIT(N(takeTurn_8021FE6C)) + EVT_END_IF + EVT_ELSE + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 500) + EVT_CALL(SetBattleVar, 1, 2) + EVT_EXEC_WAIT(N(8021E218)) + EVT_ELSE + EVT_CALL(SetBattleVar, 1, 1) + EVT_EXEC_WAIT(N(takeTurn_8021FE6C)) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(takeTurn_8021FE6C)) + EVT_CASE_EQ(2) + EVT_EXEC_WAIT(N(8021E218)) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +s32 N(IdleAnimations_8021F05C)[] = { + STATUS_KEY_NORMAL, ANIM_Goomba_Hyper_Idle, + STATUS_KEY_STONE, ANIM_Goomba_Hyper_Still, + STATUS_KEY_SLEEP, ANIM_Goomba_Hyper_Sleep, + STATUS_KEY_POISON, ANIM_Goomba_Hyper_Idle, + STATUS_KEY_STOP, ANIM_Goomba_Hyper_Still, + STATUS_KEY_STATIC, ANIM_Goomba_Hyper_Idle, + STATUS_KEY_PARALYZE, ANIM_Goomba_Hyper_Still, + STATUS_KEY_DIZZY, ANIM_Goomba_Hyper_Dizzy, + STATUS_KEY_FEAR, ANIM_Goomba_Hyper_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_8021F0A8)[] = { + STATUS_KEY_NORMAL, ANIM_Goomba_Hyper_Run, + STATUS_KEY_STONE, ANIM_Goomba_Hyper_Still, + STATUS_KEY_SLEEP, ANIM_Goomba_Hyper_Sleep, + STATUS_KEY_POISON, ANIM_Goomba_Hyper_Idle, + STATUS_KEY_STOP, ANIM_Goomba_Hyper_Still, + STATUS_KEY_STATIC, ANIM_Goomba_Hyper_Run, + STATUS_KEY_PARALYZE, ANIM_Goomba_Hyper_Still, + STATUS_KEY_DIZZY, ANIM_Goomba_Hyper_Dizzy, + STATUS_KEY_FEAR, ANIM_Goomba_Hyper_Dizzy, + STATUS_END, +}; + +EvtScript N(8021F0F4) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021FE6C))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021F140))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021F41C))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_8021F140) = { + EVT_LABEL(10) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F0A8))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F0A8))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) + EVT_LOOP(80) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_GOTO(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021F41C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Goomba_Hyper_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Goomba_Hyper_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Dizzy) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_STAR_BEAM) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021F05C))) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Run) + EVT_SET_CONST(LVar2, ANIM_Goomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Hyper_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/CalculateArcsinDeg.inc.c" + +EvtScript N(takeTurn_8021FE6C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 10) + EVT_ADD(LVar2, 3) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Sleep) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Hurt) + EVT_WAIT(5) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_THREAD + EVT_WAIT(4) + EVT_SET(LVar0, 180) + EVT_LOOP(4) + EVT_SUB(LVar0, 45) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Dizzy) + EVT_WAIT(5) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Tense) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_END_SWITCH + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle) + EVT_WAIT(3) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/jungle_fuzzy.inc.c b/src/battle/common/actor/jungle_fuzzy.inc.c new file mode 100644 index 0000000000..5827665725 --- /dev/null +++ b/src/battle/common/actor/jungle_fuzzy.inc.c @@ -0,0 +1,838 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Fuzzy.h" +#include "battle/action_cmd/stop_leech.h" + +#define NAMESPACE A(jungle_fuzzy) + +extern s32 N(IdleAnimations_8021EADC)[]; +extern EvtScript N(init_8021EB28); +extern EvtScript N(takeTurn_80221628); +extern EvtScript N(idle_8021EB8C); +extern EvtScript N(handleEvent_8021EB9C); +extern Formation N(specialFormation_8022180C); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable_8021E9D0)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_FIRE, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8021E9E4)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 95, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 70, + STATUS_KEY_PARALYZE, 75, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 20 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021EADC), + .defenseTable = N(DefenseTable_8021E9D0), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_JUNGLE_FUZZY, + .level = 16, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021EB28), + .statusTable = N(StatusTable_8021E9E4), + .escapeChance = 30, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 75, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 33, 28 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_8021EADC)[] = { + STATUS_KEY_NORMAL, ANIM_Fuzzy_Jungle_Idle, + STATUS_KEY_STONE, ANIM_Fuzzy_Jungle_Still, + STATUS_KEY_SLEEP, ANIM_Fuzzy_Jungle_Sleep, + STATUS_KEY_POISON, ANIM_Fuzzy_Jungle_Idle, + STATUS_KEY_STOP, ANIM_Fuzzy_Jungle_Still, + STATUS_KEY_STATIC, ANIM_Fuzzy_Jungle_Idle, + STATUS_KEY_PARALYZE, ANIM_Fuzzy_Jungle_Still, + STATUS_KEY_DIZZY, ANIM_Fuzzy_Jungle_Stunned, + STATUS_KEY_FEAR, ANIM_Fuzzy_Jungle_Stunned, + STATUS_END, +}; + +EvtScript N(init_8021EB28) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80221628))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021EB8C))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021EB9C))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_8021EB8C) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021EB9C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_CALL(GetLastElement, LVar0) + EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Burn) + EVT_SET_CONST(LVar2, ANIM_Fuzzy_Jungle_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Burn) + EVT_SET_CONST(LVar2, ANIM_Fuzzy_Jungle_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_CALL(func_80269470) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Run) + EVT_EXEC_WAIT(EVS_Enemy_HopHome) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_CALL(func_80269470) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_CALL(GetLastElement, LVar0) + EVT_IF_FLAG(LVar0, DAMAGE_TYPE_SHOCK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_HurtShock) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Run) + EVT_SET_CONST(LVar2, ANIM_Fuzzy_Jungle_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Run) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Fuzzy_Jungle_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(divide) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) + EVT_CALL(SetBattleCamZoom, 330) + EVT_CALL(SetBattleCamOffsetZ, 30) + EVT_CALL(MoveBattleCamOver, 20) + EVT_WAIT(20) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) + EVT_THREAD + EVT_WAIT(30) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206E) + EVT_WAIT(30) + EVT_LOOP(4) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206F) + EVT_WAIT(11) + EVT_END_LOOP + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2070) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Anim0D) + EVT_WAIT(130) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Walk) + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8022180C)), FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(SetActorPos, LVar0, LVar1, LVar2, LVar3) + EVT_CALL(SetGoalToIndex, LVar0, LVarA) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 20) + EVT_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Walk) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(JumpToGoal, ACTOR_SELF, 14, FALSE, TRUE, FALSE) + EVT_END_THREAD + EVT_WAIT(1) + EVT_CALL(SetAnimation, LVar0, 1, ANIM_Fuzzy_Jungle_Walk) + EVT_CALL(SetActorJumpGravity, LVar0, EVT_FLOAT(1.4)) + EVT_CALL(JumpToGoal, LVar0, 14, FALSE, TRUE, FALSE) + EVT_CALL(GetActorPos, LVar0, LVar1, LVar2, LVar3) + EVT_CALL(ForceHomePos, LVar0, LVar1, LVar2, LVar3) + EVT_CALL(HPBarToHome, LVar0) + EVT_CALL(SetAnimation, LVar0, 1, ANIM_Fuzzy_Jungle_Idle) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar1) + EVT_SWITCH(LVar1) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, LVar0, 0, 1) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, LVar0, 0, 2) + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/SpawnEnemyDrainFX.inc.c" + +EvtScript N(leechAttack) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_GOTO(100) + EVT_END_IF + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle) + EVT_LABEL(100) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Anim04) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 9, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) + EVT_WAIT(5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 2, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_SET(LVar1, 0) + EVT_SUB(LVar2, 5) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 11, FALSE, TRUE, FALSE) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Anim09) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 15) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_WAIT(4) + EVT_WAIT(5) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(5) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_EQ(HIT_RESULT_HIT_STATIC) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_STATIC) + EVT_SET(LFlag0, FALSE) + EVT_ELSE + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, -3, -12, -15) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 0, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAG_STONE) + EVT_WAIT(10) + EVT_LOOP(2) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Bite) + EVT_WAIT(21) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Still) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, -3, -2, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.9), EVT_FLOAT(1.2), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.8), EVT_FLOAT(1.3), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) + EVT_WAIT(2) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.6), EVT_FLOAT(1.6), EVT_FLOAT(1.0)) + EVT_WAIT(10) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 2, BS_FLAGS1_40) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) + EVT_WAIT(30) + EVT_END_LOOP + EVT_ELSE + EVT_CALL(ShowMessageBox, BTL_MSG_ACTION_TIP_03, 0x00007FFF) + EVT_CALL(ShowActionHud, TRUE) + EVT_CALL(LoadActionCommand, ACTION_COMMAND_STOP_LEECH) + EVT_CALL(action_command_stop_leech_init) + EVT_CALL(SetupMashMeter, 1, 23, 0, 0, 0, 0) + EVT_WAIT(10) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_4000, FALSE) + EVT_CALL(action_command_stop_leech_start, 0, 32767, 3) + EVT_SET(LVarD, 0) + EVT_LOOP(5) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE) + EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Leeching) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Bite) + EVT_SET(LFlag0, FALSE) + EVT_LOOP(21) + EVT_CALL(GetActionSuccessCopy, LVar1) + EVT_IF_EQ(LVar1, 1) + EVT_SET(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Still) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3E0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, -3, -2, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_SET(LFlag0, FALSE) + EVT_LOOP(1) + EVT_CALL(GetActionSuccessCopy, LVar1) + EVT_IF_EQ(LVar1, 1) + EVT_SET(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.9), EVT_FLOAT(1.2), EVT_FLOAT(1.0)) + EVT_SET(LFlag0, FALSE) + EVT_LOOP(1) + EVT_CALL(GetActionSuccessCopy, LVar1) + EVT_IF_EQ(LVar1, 1) + EVT_SET(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.8), EVT_FLOAT(1.3), EVT_FLOAT(1.0)) + EVT_SET(LFlag0, FALSE) + EVT_LOOP(1) + EVT_CALL(GetActionSuccessCopy, LVar1) + EVT_IF_EQ(LVar1, 1) + EVT_SET(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) + EVT_SET(LFlag0, FALSE) + EVT_LOOP(1) + EVT_CALL(GetActionSuccessCopy, LVar1) + EVT_IF_EQ(LVar1, 1) + EVT_SET(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) + EVT_SET(LFlag0, FALSE) + EVT_LOOP(2) + EVT_CALL(GetActionSuccessCopy, LVar1) + EVT_IF_EQ(LVar1, 1) + EVT_SET(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.6), EVT_FLOAT(1.6), EVT_FLOAT(1.0)) + EVT_SET(LFlag0, FALSE) + EVT_LOOP(10) + EVT_CALL(GetActionSuccessCopy, LVar1) + EVT_IF_EQ(LVar1, 1) + EVT_SET(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_SET(LFlag0, FALSE) + EVT_LOOP(2) + EVT_CALL(GetActionSuccessCopy, LVar1) + EVT_IF_EQ(LVar1, 1) + EVT_SET(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_UNBLOCKABLE | DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 2, BS_FLAGS1_40) + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar3) + EVT_IF_NE(LVar3, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_214) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 10) + EVT_CALL(N(SpawnDrainHealthStartFX), LVar0, LVar1, LVar2, LVar3) + EVT_THREAD + EVT_WAIT(15) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_25C) + EVT_CALL(N(SpawnDrainHealthContinueFX), LVar0, LVar1, LVar2, LVar3) + EVT_END_THREAD + EVT_ADD(LVar0, 20) + EVT_ADD(LVar1, 20) + EVT_PLAY_EFFECT(EFFECT_RECOVER, 0, LVar0, LVar1, LVar2, LVar3, 0) + EVT_CALL(GetActorHP, ACTOR_SELF, LVar0) + EVT_ADD(LVar0, LVar3) + EVT_CALL(SetEnemyHP, ACTOR_SELF, LVar0) + EVT_ELSE + EVT_ADD(LVarD, 1) + EVT_IF_GT(LVarD, 1) + EVT_CALL(func_80269470) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) + EVT_CALL(GetPlayerHP, LVar1) + EVT_IF_EQ(LVar1, 0) + EVT_CALL(func_80269470) + EVT_BREAK_LOOP + EVT_END_IF + EVT_SET(LFlag0, FALSE) + EVT_LOOP(35) + EVT_CALL(GetActionSuccessCopy, LVar1) + EVT_IF_EQ(LVar1, 1) + EVT_SET(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LFlag0, TRUE) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_CALL(func_80269470) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump) + EVT_END_IF + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_THREAD + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.6), EVT_FLOAT(0.6), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 330) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.5), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 300) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 270) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(0.7), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 240) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 210) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(0.7), EVT_FLOAT(1.4), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 180) + EVT_WAIT(2) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(0.7), EVT_FLOAT(1.0)) + EVT_WAIT(2) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.2), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_END_THREAD + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.4), EVT_FLOAT(0.2), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_THREAD + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.2), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 150) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 120) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 90) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 60) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 30) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(802210E0) = { + EVT_SET(LFlag1, FALSE) + EVT_SET(LFlag2, FALSE) + EVT_SET(LFlag3, FALSE) + EVT_SET(LFlag4, FALSE) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar5) + EVT_CALL(GetIndexFromHome, LVar0, LVar5) + EVT_MOD(LVar5, 4) + EVT_SWITCH(LVar5) + EVT_CASE_EQ(0) + EVT_SET(LFlag1, TRUE) + EVT_CASE_EQ(1) + EVT_SET(LFlag2, TRUE) + EVT_CASE_EQ(2) + EVT_SET(LFlag3, TRUE) + EVT_CASE_EQ(3) + EVT_SET(LFlag4, TRUE) + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_SET(LVarA, -1) + EVT_SET(LVarB, -1) + EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_IF_EQ(LFlag2, FALSE) + EVT_SET(LVarA, 1) + EVT_END_IF + EVT_CASE_EQ(1) + EVT_IF_EQ(LFlag1, FALSE) + EVT_SET(LVarA, 0) + EVT_END_IF + EVT_IF_EQ(LFlag3, FALSE) + EVT_IF_EQ(LVarA, -1) + EVT_SET(LVarA, 2) + EVT_ELSE + EVT_SET(LVarB, 2) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(2) + EVT_IF_EQ(LFlag2, FALSE) + EVT_SET(LVarA, 1) + EVT_END_IF + EVT_IF_EQ(LFlag4, FALSE) + EVT_IF_EQ(LVarA, -1) + EVT_SET(LVarA, 3) + EVT_ELSE + EVT_SET(LVarB, 3) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(3) + EVT_IF_EQ(LFlag3, FALSE) + EVT_SET(LVarA, 2) + EVT_END_IF + EVT_END_SWITCH + EVT_IF_NE(LVarB, -1) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 500) + EVT_SET(LVarA, LVarB) + EVT_END_IF + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(80221468) = { + EVT_SET(LVar9, 0) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetOriginalActorType, LVar0, LVar2) + EVT_SWITCH(LVar2) + EVT_CASE_OR_EQ(ACTOR_TYPE_FOREST_FUZZY) + EVT_CASE_OR_EQ(ACTOR_TYPE_JUNGLE_FUZZY) + EVT_CALL(GetStatusFlags, LVar0, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(GetActorVar, LVar0, 0, LVar3) + EVT_IF_NE(LVar3, 2) + EVT_ADD(LVar9, 1) + EVT_END_IF + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(ACTOR_TYPE_SPEAR_GUY) + EVT_CALL(GetStatusFlags, LVar0, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(GetActorVar, LVar0, 1, LVar3) + EVT_IF_LT(LVar3, 2) + EVT_ADD(LVar9, 1) + EVT_END_IF + EVT_END_IF + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_80221628) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_EXEC_WAIT(N(leechAttack)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 2) + EVT_EXEC_WAIT(N(leechAttack)) + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(802210E0)) + EVT_IF_EQ(LVarA, -1) + EVT_EXEC_WAIT(N(leechAttack)) + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(80221468)) + EVT_SWITCH(LVar9) + EVT_CASE_EQ(1) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 400) + EVT_EXEC_WAIT(N(divide)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(2) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 150) + EVT_EXEC_WAIT(N(divide)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(3) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 70) + EVT_EXEC_WAIT(N(divide)) + EVT_RETURN + EVT_END_IF + EVT_END_SWITCH + EVT_EXEC_WAIT(N(leechAttack)) + EVT_RETURN + EVT_END +}; + +Vec3i N(vector3D_80221800) = { NPC_DISPOSE_LOCATION }; + +Formation N(specialFormation_8022180C) = { + ACTOR_BY_POS(NAMESPACE, N(vector3D_80221800), 0), +}; diff --git a/src/battle/common/actor/koopa_troopa.inc.c b/src/battle/common/actor/koopa_troopa.inc.c index 4e0cfe6411..afb198fda1 100644 --- a/src/battle/common/actor/koopa_troopa.inc.c +++ b/src/battle/common/actor/koopa_troopa.inc.c @@ -4,17 +4,28 @@ #include "script_api/battle.h" #include "sprite/npc/KoopaTroopa.h" -extern EvtScript N(init); -extern EvtScript N(idle); -extern EvtScript N(takeTurn); -extern EvtScript N(handleEvent); -extern s32 N(IdleAnimations)[]; +#define NAMESPACE A(koopa_troopa) + +extern EvtScript N(EVS_Init); +extern s32 N(DefaultAnims)[]; +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); enum N(ActorPartIDs) { PRT_MAIN = 1, }; -s32 N(DefenseTable)[] = { +enum N(ActorVars) { + AVAR_IsFlipped = 8, + AVAR_FlippedTurns = 9, +}; + +enum N(ActorParams) { + DMG_SHELL_TOSS = 1, +}; + +s32 N(NormalDefense)[] = { ELEMENT_NORMAL, 1, ELEMENT_SMASH, 1, ELEMENT_JUMP, 1, @@ -23,7 +34,7 @@ s32 N(DefenseTable)[] = { ELEMENT_END, }; -s32 N(DefenseTable_Flipped)[] = { +s32 N(FlippedDefense)[] = { ELEMENT_NORMAL, 0, ELEMENT_END, }; @@ -60,8 +71,8 @@ ActorPartBlueprint N(ActorParts)[] = { .posOffset = { 0, 0, 0 }, .targetOffset = { -2, 36 }, .opacity = 255, - .idleAnimations = N(IdleAnimations), - .defenseTable = N(DefenseTable), + .idleAnimations = N(DefaultAnims), + .defenseTable = N(NormalDefense), .eventFlags = ACTOR_EVENT_FLAG_FLIPABLE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, -7 }, @@ -75,7 +86,7 @@ ActorBlueprint NAMESPACE = { .maxHP = 4, .partCount = ARRAY_COUNT(N(ActorParts)), .partsData = N(ActorParts), - .initScript = &N(init), + .initScript = &N(EVS_Init), .statusTable = N(StatusTable), .escapeChance = 70, .airLiftChance = 90, @@ -91,7 +102,7 @@ ActorBlueprint NAMESPACE = { .statusTextOffset = { 5, 32 }, }; -s32 N(IdleAnimations)[] = { +s32 N(DefaultAnims)[] = { STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Idle, STATUS_KEY_STONE, ANIM_KoopaTroopa_Still, STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Sleep, @@ -104,7 +115,7 @@ s32 N(IdleAnimations)[] = { STATUS_END, }; -s32 N(IdleAnimations_8021CADC)[] = { +s32 N(ShuffleAnims)[] = { STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Walk, STATUS_KEY_STONE, ANIM_KoopaTroopa_Still, STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Sleep, @@ -117,7 +128,7 @@ s32 N(IdleAnimations_8021CADC)[] = { STATUS_END, }; -s32 N(IdleAnimations_flipped)[] = { +s32 N(FlippedAnims)[] = { STATUS_KEY_NORMAL, ANIM_KoopaTroopa_ToppleStruggle, STATUS_KEY_STONE, ANIM_KoopaTroopa_ToppleStill, STATUS_KEY_SLEEP, ANIM_KoopaTroopa_ToppleSleep, @@ -130,18 +141,18 @@ s32 N(IdleAnimations_flipped)[] = { STATUS_END, }; -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_IsFlipped, FALSE) EVT_RETURN EVT_END }; #include "common/battle/SetAbsoluteStatusOffsets.inc.c" -EvtScript N(8021CBD8) = { +EvtScript N(EVS_UpdateTargetOffsets) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(0) EVT_IF_FLAG(LVar1, STATUS_FLAG_SLEEP | STATUS_FLAG_DIZZY) @@ -162,89 +173,89 @@ EvtScript N(8021CBD8) = { EVT_END }; -EvtScript N(idle) = { +EvtScript N(EVS_Idle) = { EVT_LABEL(0) - EVT_CALL(RandInt, 80, LVarA) - EVT_ADD(LVarA, 80) - EVT_LOOP(LVarA) - EVT_LABEL(1) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(8021CBD8)) - EVT_IF_EQ(LVar0, 1) + EVT_CALL(RandInt, 80, LVarA) + EVT_ADD(LVarA, 80) + EVT_LOOP(LVarA) + EVT_LABEL(1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(EVS_UpdateTargetOffsets)) + EVT_IF_EQ(LVar0, 1) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(ShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(FlippedAnims))) + EVT_END_SWITCH + EVT_LOOP(20) + EVT_LABEL(2) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(EVS_UpdateTargetOffsets)) + EVT_IF_EQ(LVar0, 1) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021CADC))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) - EVT_END_SWITCH - EVT_LOOP(20) - EVT_LABEL(2) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(8021CBD8)) - EVT_IF_EQ(LVar0, 1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(ShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(FlippedAnims))) + EVT_END_SWITCH + EVT_LOOP(80) + EVT_LABEL(3) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(EVS_UpdateTargetOffsets)) + EVT_IF_EQ(LVar0, 1) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021CADC))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) - EVT_END_SWITCH - EVT_LOOP(80) - EVT_LABEL(3) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(8021CBD8)) - EVT_IF_EQ(LVar0, 1) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(0) + EVT_END_LOOP + EVT_GOTO(0) EVT_RETURN EVT_END }; s32 N(FlipPosOffsets)[] = { 9, 16, 22, 26, 30, 32, 33, 32, 30, 26, 22, 16, 9, 0, 4, 6, 7, 6, 4, 0, 2, 0 }; -EvtScript N(handleEvent) = { +EvtScript N(EVS_HandleEvent) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetActorYaw, ACTOR_SELF, 0) @@ -252,41 +263,41 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_BurnHurt) EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_BurnHurt) EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 9, 2) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_Flipped))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_flipped))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_IsFlipped, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlippedTurns, 2) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(FlippedDefense))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(FlippedAnims))) EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) @@ -317,31 +328,31 @@ EvtScript N(handleEvent) = { EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ToppleStruggle) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ShellEnter) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) @@ -350,24 +361,24 @@ EvtScript N(handleEvent) = { EVT_WAIT(10) EVT_END_IF EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_END_IF @@ -375,58 +386,58 @@ EvtScript N(handleEvent) = { EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Run) EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Panic) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Panic) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF @@ -437,7 +448,7 @@ EvtScript N(handleEvent) = { EVT_END }; -EvtScript N(takeTurn) = { +EvtScript N(EVS_TakeTurn) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) @@ -445,12 +456,12 @@ EvtScript N(takeTurn) = { EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ShellSpin) EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 9, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_FlippedTurns, LVar0) EVT_SUB(LVar0, 1) EVT_IF_GT(LVar0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 9, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlippedTurns, LVar0) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(3.0)) EVT_WAIT(30) @@ -483,9 +494,9 @@ EvtScript N(takeTurn) = { EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Idle) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_IsFlipped, FALSE) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(NormalDefense))) EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) @@ -576,7 +587,7 @@ EvtScript N(takeTurn) = { EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, DMG_SHELL_TOSS, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_HIT) EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) @@ -596,7 +607,7 @@ EvtScript N(takeTurn) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ShellExit) EVT_WAIT(8) EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Idle) diff --git a/src/battle/common/actor/koopatrol.inc.c b/src/battle/common/actor/koopatrol.inc.c index 858cd33e2e..3daabe1743 100644 --- a/src/battle/common/actor/koopatrol.inc.c +++ b/src/battle/common/actor/koopatrol.inc.c @@ -1,9 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Koopatrol.h" #include "effects.h" +#define NAMESPACE A(koopatrol) + extern EvtScript N(init); extern EvtScript N(takeTurn); extern EvtScript N(idle); @@ -339,27 +340,27 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(N(STATE_NORMAL)) EVT_CASE_OR_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_SWITCH EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0C) EVT_SET_CONST(LVar2, ANIM_Koopatrol_Anim0D) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0C) EVT_SET_CONST(LVar2, ANIM_Koopatrol_Anim0D) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0D) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -368,12 +369,12 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(N(STATE_NORMAL)) EVT_CASE_OR_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_END_CASE_GROUP EVT_CASE_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim06) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_END_SWITCH @@ -382,20 +383,20 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(N(STATE_NORMAL)) EVT_CASE_OR_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_CASE_GROUP EVT_CASE_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim06) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Koopatrol_Anim08) EVT_WAIT(5) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_SWITCH @@ -433,23 +434,23 @@ EvtScript N(handleEvent) = { EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Koopatrol_Anim0F) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -466,7 +467,7 @@ EvtScript N(handleEvent) = { EVT_CALL(EnableActorGlow, ACTOR_SELF, FALSE) EVT_END_IF EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim08) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF @@ -475,7 +476,7 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(N(STATE_NORMAL)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim07) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) @@ -484,11 +485,11 @@ EvtScript N(handleEvent) = { EVT_WAIT(10) EVT_END_IF EVT_CASE_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0F) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim06) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_SWITCH @@ -527,22 +528,22 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(N(STATE_NORMAL)) EVT_CASE_OR_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END_CASE_GROUP EVT_CASE_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Koopatrol_Anim08) EVT_WAIT(5) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -551,15 +552,15 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(N(STATE_NORMAL)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0F) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_END_SWITCH @@ -568,14 +569,14 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(N(STATE_NORMAL)) EVT_CASE_OR_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim04) EVT_SET_CONST(LVar2, ANIM_Koopatrol_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_END_CASE_GROUP EVT_CASE_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0F) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_SWITCH @@ -583,15 +584,15 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(N(STATE_NORMAL)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim16) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0F) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0F) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_END_SWITCH @@ -599,13 +600,13 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(N(STATE_NORMAL)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim16) EVT_CASE_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0F) EVT_CASE_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0F) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_BlowAway) @@ -614,13 +615,13 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_STATE), LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(N(STATE_NORMAL)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim01) EVT_CASE_EQ(N(STATE_FLIPPED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0F) EVT_CASE_EQ(N(STATE_CHARGED)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim0F) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) @@ -791,7 +792,7 @@ EvtScript N(attackShellToss) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Koopatrol_Anim08) EVT_WAIT(8) EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Koopatrol_Anim01) @@ -965,7 +966,7 @@ EvtScript N(attackShellMissile) = { EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) EVT_CALL(SetActorPos, ACTOR_SELF, 300, 0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Koopatrol_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Koopatrol_Anim01) @@ -1086,7 +1087,7 @@ EvtScript N(summonFriend) = { EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SummonEnemy, EVT_PTR(N(summon_formation)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(summon_formation)), FALSE) EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) EVT_ADD(LVar1, 200) EVT_CALL(SetActorPos, LVar0, LVar1, LVar2, LVar3) diff --git a/src/battle/common/actor/lakitu.inc.c b/src/battle/common/actor/lakitu.inc.c new file mode 100644 index 0000000000..404d86441b --- /dev/null +++ b/src/battle/common/actor/lakitu.inc.c @@ -0,0 +1,609 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Spiny.h" +#include "sprite/npc/Lakitu.h" +#include "effects.h" + +#define NAMESPACE A(lakitu) + +extern ActorBlueprint A(spiny); + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_Lakitu_Anim01, + STATUS_KEY_STONE, ANIM_Lakitu_Anim00, + STATUS_KEY_SLEEP, ANIM_Lakitu_Anim08, + STATUS_KEY_POISON, ANIM_Lakitu_Anim01, + STATUS_KEY_STOP, ANIM_Lakitu_Anim00, + STATUS_KEY_STATIC, ANIM_Lakitu_Anim01, + STATUS_KEY_PARALYZE, ANIM_Lakitu_Anim00, + STATUS_KEY_DIZZY, ANIM_Lakitu_Anim09, + STATUS_KEY_FEAR, ANIM_Lakitu_Anim09, + STATUS_END, +}; + +s32 N(IdleAnimations2)[] = { + STATUS_KEY_NORMAL, ANIM_Lakitu_Anim0B, + STATUS_END, +}; + +s32 N(IdleAnimations3)[] = { + STATUS_KEY_NORMAL, ANIM_Spiny_Anim01, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_MYSTERY, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 50, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 100, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 50, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 80, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, -1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -5, 35 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -13 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations2), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations3), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_LAKITU, + .level = 20, + .maxHP = 12, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 40, + .airLiftChance = 90, + .hurricaneChance = 90, + .spookChance = 50, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 85, + .coinReward = 2, + .size = { 32, 38 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -11, 20 }, + .statusTextOffset = { 10, 34 }, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(returnHome) = { + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim03) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim05) + EVT_SET_CONST(LVar2, ANIM_Lakitu_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim05) + EVT_SET_CONST(LVar2, ANIM_Lakitu_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) + EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) + EVT_CALL(HPBarToCurrent, ACTOR_SELF) + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim03) + EVT_SET_CONST(LVar2, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Lakitu_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(attackSpinyFlip) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim03) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, -20, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Lakitu_Anim0B) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim12) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim13) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, -3) + EVT_ADD(LVar1, 16) + EVT_ADD(LVar2, 2) + EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, EVT_FLOAT(0.4), 10, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 12) + EVT_ADD(LVar2, 0) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) + EVT_ELSE + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, -8) + EVT_ADD(LVar1, 40) + EVT_ADD(LVar2, 5) + EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 10, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 30) + EVT_ADD(LVar2, 2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_END_IF + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim15) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Lakitu_Anim0C) + EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_2, SOUND_20D2) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 20, TRUE) + EVT_SUB(LVar0, 30) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 10, TRUE) + EVT_SUB(LVar0, 20) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 5, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_WAIT(20) + EVT_CALL(YieldTurn) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, 20, TRUE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(2) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_THREAD + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 40) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 20, TRUE) + EVT_SUB(LVar0, 30) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 10, TRUE) + EVT_SUB(LVar0, 20) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 5, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_END_THREAD + EVT_WAIT(20) + EVT_CALL(YieldTurn) + EVT_EXEC_WAIT(N(returnHome)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +Vec3i N(spiny_pos) = { NPC_DISPOSE_LOCATION }; + +Formation N(formation_spiny) = { + ACTOR_BY_POS(A(spiny), N(spiny_pos), 100, 1), +}; + +EvtScript N(summonSpiny) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_spiny)), FALSE) + EVT_CALL(CopyStatusEffects, ACTOR_SELF, LVar0) + EVT_SET(LVarB, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Lakitu_Anim0B) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim12) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim13) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, -3) + EVT_ADD(LVar1, 16) + EVT_ADD(LVar2, 2) + EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, EVT_FLOAT(0.4), 10, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 12) + EVT_ADD(LVar2, 0) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) + EVT_ELSE + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, -8) + EVT_ADD(LVar1, 40) + EVT_ADD(LVar2, 5) + EVT_PLAY_EFFECT(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 10, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 30) + EVT_ADD(LVar2, 2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_END_IF + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_WAIT(10) + EVT_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim15) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01) + EVT_END_THREAD + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_2, SOUND_20D2) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Lakitu_Anim0C) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.6)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 40) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 12, TRUE) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, 0, LVar2) + EVT_SUB(LVar0, 30) + EVT_THREAD + EVT_CALL(SetPartRotationOffset, ACTOR_SELF, PRT_3, 0, 16, 0) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_SET(LFlag0, FALSE) + EVT_LOOP(12) + EVT_ADD(LVar0, 30) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, LVar0) + EVT_ADD(LVar1, 1) + EVT_IF_GE(LVar1, 6) + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_SET(LFlag0, FALSE) + EVT_ELSE + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_3, EVT_FLOAT(1.3)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_3, LVar0, 0, LVar2, 12, TRUE) + EVT_END_THREAD + EVT_WAIT(1) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(1.3)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 12, TRUE) + EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 1, LVar0, 0, LVar2, 0, 0) + EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_CALL(SetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetAnimation, LVarB, 1, ANIM_Spiny_Anim01) + EVT_WAIT(20) + EVT_CALL(SetAnimation, LVarB, 1, ANIM_Spiny_Anim04) + EVT_CALL(SetGoalToIndex, LVarB, LVarA) + EVT_CALL(GetGoalPos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(GetActorPos, LVarB, LVar3, LVar4, LVar5) + EVT_IF_LT(LVar0, LVar3) + EVT_CALL(SetActorYaw, LVarB, 0) + EVT_ELSE + EVT_CALL(SetActorYaw, LVarB, 180) + EVT_END_IF + EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, LVarB, 0, FALSE) + EVT_CALL(SetAnimation, LVarB, 1, ANIM_Spiny_Anim01) + EVT_CALL(SetActorYaw, LVarB, 0) + EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(HPBarToHome, LVarB) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_ADD(LVar0, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, LVar0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(findPlacesForSummon) = { + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar5) + EVT_CALL(GetIndexFromHome, LVar0, LVar5) + EVT_MOD(LVar5, 4) + EVT_SWITCH(LVar5) + EVT_CASE_EQ(0) + EVT_SET(LFlag1, TRUE) + EVT_CASE_EQ(1) + EVT_SET(LFlag2, TRUE) + EVT_CASE_EQ(2) + EVT_SET(LFlag3, TRUE) + EVT_CASE_EQ(3) + EVT_SET(LFlag4, TRUE) + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_IF_EQ(LFlag1, FALSE) + EVT_SET(LVarA, 0) + EVT_RETURN + EVT_END_IF + EVT_IF_EQ(LFlag2, FALSE) + EVT_SET(LVarA, 1) + EVT_RETURN + EVT_END_IF + EVT_IF_EQ(LFlag3, FALSE) + EVT_SET(LVarA, 2) + EVT_RETURN + EVT_END_IF + EVT_IF_EQ(LFlag4, FALSE) + EVT_SET(LVarA, 3) + EVT_RETURN + EVT_END_IF + EVT_SET(LVarA, -1) + EVT_RETURN + EVT_END +}; + +EvtScript N(calcSummonChance) = { + EVT_SET(LVar9, 0) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetOriginalActorType, LVar0, LVar2) + EVT_SWITCH(LVar2) + EVT_CASE_EQ(ACTOR_TYPE_LAKITU) + EVT_CALL(GetStatusFlags, LVar0, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(GetActorVar, LVar0, 0, LVar3) + EVT_IF_LT(LVar3, 3) + EVT_ADD(LVar9, 1) + EVT_END_IF + EVT_END_IF + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_GE(LVar0, 3) + EVT_EXEC_WAIT(N(attackSpinyFlip)) + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(findPlacesForSummon)) + EVT_IF_EQ(LVarA, -1) + EVT_EXEC_WAIT(N(attackSpinyFlip)) + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(calcSummonChance)) + EVT_SWITCH(LVar9) + EVT_CASE_EQ(1) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 500) + EVT_EXEC_WAIT(N(summonSpiny)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(2) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 250) + EVT_EXEC_WAIT(N(summonSpiny)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(3) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 150) + EVT_EXEC_WAIT(N(summonSpiny)) + EVT_RETURN + EVT_END_IF + EVT_END_SWITCH + EVT_EXEC_WAIT(N(attackSpinyFlip)) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/lava_bubble.inc.c b/src/battle/common/actor/lava_bubble.inc.c new file mode 100644 index 0000000000..b097770789 --- /dev/null +++ b/src/battle/common/actor/lava_bubble.inc.c @@ -0,0 +1,685 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/LavaBubble.h" + +#define NAMESPACE A(lava_bubble) + +extern s32 N(IdleAnimations_80218FC4)[]; +extern s32 N(IdleAnimations_80219010)[]; +extern EvtScript N(init_8021901C); +extern EvtScript N(takeTurn_8021AEA4); +extern EvtScript N(idle_802191E4); +extern EvtScript N(handleEvent_80219500); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, + PRT_4 = 4, + PRT_5 = 5, +}; + +s32 N(DefenseTable_80218E10)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_WATER, -2, + ELEMENT_ICE, -2, + ELEMENT_FIRE, 99, + ELEMENT_BLAST, -1, + ELEMENT_END, +}; + +s32 N(StatusTable_80218E3C)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 50, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 100, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 50, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 85, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -2, 25 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80218FC4), + .defenseTable = N(DefenseTable_80218E10), + .eventFlags = ACTOR_EVENT_FLAG_FIREY, + .elementImmunityFlags = ELEMENT_FIRE, + .projectileTargetOffset = { -3, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80219010), + .defenseTable = N(DefenseTable_80218E10), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80219010), + .defenseTable = N(DefenseTable_80218E10), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_4, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80219010), + .defenseTable = N(DefenseTable_80218E10), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_5, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80219010), + .defenseTable = N(DefenseTable_80218E10), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_LAVA_BUBBLE, + .level = 17, + .maxHP = 9, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021901C), + .statusTable = N(StatusTable_80218E3C), + .escapeChance = 50, + .airLiftChance = 90, + .hurricaneChance = 85, + .spookChance = 50, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 80, + .coinReward = 1, + .size = { 33, 32 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_80218FC4)[] = { + STATUS_KEY_NORMAL, ANIM_LavaBubble_Anim01, + STATUS_KEY_STONE, ANIM_LavaBubble_Anim00, + STATUS_KEY_SLEEP, ANIM_LavaBubble_Anim01, + STATUS_KEY_POISON, ANIM_LavaBubble_Anim01, + STATUS_KEY_STOP, ANIM_LavaBubble_Anim00, + STATUS_KEY_STATIC, ANIM_LavaBubble_Anim01, + STATUS_KEY_PARALYZE, ANIM_LavaBubble_Anim00, + STATUS_KEY_DIZZY, ANIM_LavaBubble_Anim0A, + STATUS_KEY_FEAR, ANIM_LavaBubble_Anim0A, + STATUS_END, +}; + +s32 N(IdleAnimations_80219010)[] = { + STATUS_KEY_NORMAL, ANIM_LavaBubble_Anim01, + STATUS_END, +}; + +EvtScript N(init_8021901C) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021AEA4))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_802191E4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80219500))) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_END_SWITCH + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_5, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 5) + EVT_CALL(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_802191E4) = { + EVT_LABEL(0) + EVT_CALL(MakeLerp, 0, 10, 25, EASING_COS_IN_OUT) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(GetHomePos, ACTOR_SELF, LVar2, LVar3, LVar4) + EVT_ADD(LVar0, LVar3) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar2, LVar0, LVar4) + EVT_IF_EQ(LVar1, 1) + EVT_LABEL(11) + EVT_WAIT(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_GOTO(11) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_GOTO(11) + EVT_END_IF + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(MakeLerp, 10, 0, 25, EASING_COS_IN_OUT) + EVT_LABEL(2) + EVT_CALL(UpdateLerp) + EVT_CALL(GetHomePos, ACTOR_SELF, LVar2, LVar3, LVar4) + EVT_ADD(LVar0, LVar3) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar2, LVar0, LVar4) + EVT_IF_EQ(LVar1, 1) + EVT_LABEL(22) + EVT_WAIT(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_GOTO(22) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_GOTO(22) + EVT_END_IF + EVT_GOTO(2) + EVT_END_IF + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +#include "common/UnkSfxFunc.inc.c" + +EvtScript N(80219464) = { + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_THREAD + EVT_CALL(N(UnkSfxFunc)) + EVT_END_THREAD + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80219500) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim08) + EVT_SET_CONST(LVar2, ANIM_LavaBubble_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim08) + EVT_SET_CONST(LVar2, ANIM_LavaBubble_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_EXEC_WAIT(N(80219464)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_CASE_OR_EQ(EVENT_BURN_TAUNT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) + EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) + EVT_CALL(HPBarToCurrent, ACTOR_SELF) + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_EXEC_WAIT(N(80219464)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim03) + EVT_SET_CONST(LVar2, ANIM_LavaBubble_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_LavaBubble_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_UP_AND_AWAY) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(fireTackle) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 5) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_THREAD + EVT_CALL(N(UnkSfxFunc)) + EVT_END_THREAD + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim01) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_ADD(LVar2, 1) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 10) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 3, FALSE, TRUE, FALSE) + EVT_WAIT(14) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_EXEC_WAIT(N(80219464)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar2, 1) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_SET(LVar0, 1) + EVT_SET(LVar1, 4587524) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_WAIT(5) + EVT_EXEC_WAIT(N(80219464)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021A074) = { + EVT_SET(LVar6, 2) + EVT_LOOP(4) + EVT_THREAD + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) + EVT_CALL(SetPartScale, ACTOR_SELF, LVar6, EVT_FLOAT(0.2), EVT_FLOAT(0.2), EVT_FLOAT(0.2)) + EVT_ELSE + EVT_CALL(SetPartScale, ACTOR_SELF, LVar6, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_END_IF + EVT_CALL(SetPartPos, ACTOR_SELF, LVar6, LVar0, LVar1, LVar2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar6, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, LVar6, EVT_FLOAT(8.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, LVar6, EVT_FLOAT(0.01)) + EVT_CALL(SetPartSounds, ACTOR_SELF, LVar6, ACTOR_SOUND_JUMP, 720, 0) + EVT_CALL(JumpPartTo, ACTOR_SELF, LVar6, LVar3, LVar4, LVar5, 0, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, LVar6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_END_THREAD + EVT_WAIT(3) + EVT_ADD(LVar6, 1) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(8021A218) = { + EVT_EXEC(N(8021A074)) + EVT_CALL(GetDistanceToGoal, ACTOR_SELF, LVar0) + EVT_DIVF(LVar0, EVT_FLOAT(8.0)) + EVT_ADD(LVar0, 1) + EVT_WAIT(LVar0) + EVT_RETURN + EVT_END +}; + +EvtScript N(fireballs_Partner) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PARTNER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_IF_EQ(LVarA, 1) + EVT_ADD(LVar0, 100) + EVT_SET(LVar1, 5) + EVT_ELSE + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 50) + EVT_END_IF + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_THREAD + EVT_CALL(N(UnkSfxFunc)) + EVT_END_THREAD + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim01) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim05) + EVT_WAIT(30) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim06) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_ADD(LVar1, 4) + EVT_ADD(LVar2, 2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_SUB(LVar3, 100) + EVT_ADD(LVar5, 2) + EVT_EXEC_WAIT(N(8021A218)) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(20) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_EXEC_WAIT(N(80219464)) + EVT_WAIT(20) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim06) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_ADD(LVar1, 4) + EVT_ADD(LVar2, 2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_SUB(LVar4, 6) + EVT_ADD(LVar5, 2) + EVT_EXEC_WAIT(N(8021A218)) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_NO_CONTACT, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_WAIT(20) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_EXEC_WAIT(N(80219464)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(fireballs_Player) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_THREAD + EVT_CALL(N(UnkSfxFunc)) + EVT_END_THREAD + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_SIN_OUT) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_WAIT(10) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2CF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_ADD(LVar2, 2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(30) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_EXEC_WAIT(N(80219464)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_WAIT(5) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2CF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_SET(LVarA, LVar0) + EVT_SET(LVarB, LVar1) + EVT_SET(LVarC, LVar2) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar2, 2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVarA, LVarB, LVarC) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) + EVT_WAIT(20) + EVT_EXEC_WAIT(N(80219464)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021AEA4) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(fireTackle)) + EVT_CASE_EQ(0) + EVT_EXEC_WAIT(N(fireballs_Player)) + EVT_END_SWITCH + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(1) + EVT_CALL(GetStatusFlags, ACTOR_PARTNER, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_KO) + EVT_EXEC_WAIT(N(fireTackle)) + EVT_ELSE + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LE(LVar0, 300) + EVT_EXEC_WAIT(N(fireballs_Partner)) + EVT_ELSE + EVT_EXEC_WAIT(N(fireTackle)) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(0) + EVT_CALL(GetStatusFlags, ACTOR_PARTNER, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_KO) + EVT_EXEC_WAIT(N(fireballs_Player)) + EVT_ELSE + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LE(LVar0, 300) + EVT_EXEC_WAIT(N(fireballs_Partner)) + EVT_ELSE + EVT_EXEC_WAIT(N(fireballs_Player)) + EVT_END_IF + EVT_END_IF + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/m_bush.inc.c b/src/battle/common/actor/m_bush.inc.c new file mode 100644 index 0000000000..de8de4c5f6 --- /dev/null +++ b/src/battle/common/actor/m_bush.inc.c @@ -0,0 +1,298 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/MBush.h" + +#define NAMESPACE A(m_bush) + +extern EvtScript N(init_80221988); +extern EvtScript N(takeTurn_80221F78); +extern EvtScript N(idle_802219D4); +extern EvtScript N(handleEvent_80221A74); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(IdleAnimations_80221830)[] = { + STATUS_KEY_NORMAL, ANIM_MBush_Anim02, + STATUS_KEY_STONE, ANIM_MBush_Anim01, + STATUS_KEY_SLEEP, ANIM_MBush_Anim08, + STATUS_KEY_POISON, ANIM_MBush_Anim02, + STATUS_KEY_STOP, ANIM_MBush_Anim01, + STATUS_KEY_STATIC, ANIM_MBush_Anim02, + STATUS_KEY_PARALYZE, ANIM_MBush_Anim01, + STATUS_KEY_DIZZY, ANIM_MBush_Anim09, + STATUS_KEY_FEAR, ANIM_MBush_Anim09, + STATUS_END, +}; + +s32 N(DefenseTable_8022187C)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_FIRE, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_80221890)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 95, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts_8022193C)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -2, 22 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80221830), + .defenseTable = N(DefenseTable_8022187C), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_M_BUSH, + .level = 16, + .maxHP = 8, + .partCount = ARRAY_COUNT( N(ActorParts_8022193C)), + .partsData = N(ActorParts_8022193C), + .initScript = &N(init_80221988), + .statusTable = N(StatusTable_80221890), + .escapeChance = 70, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 60, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 85, + .coinReward = 1, + .size = { 32, 30 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(init_80221988) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80221F78))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_802219D4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80221A74))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_802219D4) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(802219E4) = { + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim05) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim02) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80221A74) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim0A) + EVT_SET_CONST(LVar2, ANIM_MBush_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim0A) + EVT_SET_CONST(LVar2, ANIM_MBush_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(802219E4)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim02) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim05) + EVT_SET_CONST(LVar2, ANIM_MBush_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim05) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_MBush_Anim05) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_80221F78) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_20C9, 0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim06) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim02) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(802219E4)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim06) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 2, 25), 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MBush_Anim02) + EVT_WAIT(8) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(802219E4)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/magikoopa.inc.c b/src/battle/common/actor/magikoopa.inc.c index c1201a140f..0bdde4a3e2 100644 --- a/src/battle/common/actor/magikoopa.inc.c +++ b/src/battle/common/actor/magikoopa.inc.c @@ -1,10 +1,11 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Magikoopa.h" #include "sprite/npc/FlyingMagikoopa.h" #include "effects.h" +#define NAMESPACE A(magikoopa) + extern EvtScript N(init); extern EvtScript N(idle); extern EvtScript N(takeTurn); @@ -521,52 +522,52 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_FLAG_HIT_COMBO), LVar0) EVT_BITWISE_OR_CONST(LVar0, 0x1) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLAG_HIT_COMBO), LVar0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(EVENT_HIT) EVT_CASE_OR_EQ(EVENT_UP_AND_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(removeClone)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(removeClone)) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(removeClone)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(removeClone)) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(removeClone)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_FLAG_HIT_COMBO), LVar0) @@ -579,17 +580,17 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(removeClone)) EVT_END_IF EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(removeClone)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -604,7 +605,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -617,16 +618,16 @@ EvtScript N(handleEvent) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_MAIN, -4, 5, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(removeClone)) @@ -649,27 +650,27 @@ EvtScript N(handleEvent_flying) = { EVT_BITWISE_OR_CONST(LVar0, 1) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_FLAG_HIT_COMBO), LVar0) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(EVENT_HIT) EVT_CASE_OR_EQ(EVENT_FALL_TRIGGER) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(removeClone)) EVT_EXEC_WAIT(N(knockOff)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_UP_AND_AWAY) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(removeClone)) EVT_CASE_OR_EQ(EVENT_BURN_HIT) EVT_CASE_OR_EQ(EVENT_15) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -677,35 +678,35 @@ EvtScript N(handleEvent_flying) = { EVT_EXEC_WAIT(N(knockOff)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(removeClone)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(removeClone)) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_EXEC_WAIT(N(removeClone)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_FLAG_HIT_COMBO), LVar0) @@ -718,12 +719,12 @@ EvtScript N(handleEvent_flying) = { EVT_EXEC_WAIT(N(removeClone)) EVT_END_IF EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(removeClone)) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -738,7 +739,7 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_FlyingMagikoopa_Anim01) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -753,7 +754,7 @@ EvtScript N(handleEvent_flying) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -766,16 +767,16 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, -15, 0, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(removeClone)) @@ -1418,9 +1419,9 @@ EvtScript N(makeClone) = { EVT_SET(LFlag0, TRUE) EVT_END_IF EVT_IF_EQ(LFlag0, FALSE) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_clone)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_clone)), FALSE) EVT_ELSE - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_clone_flying)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_clone_flying)), FALSE) EVT_END_IF EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_CLONE_ID), LVar0) EVT_SET(LVarA, LVar0) diff --git a/src/battle/common/actor/medi_guy.inc.c b/src/battle/common/actor/medi_guy.inc.c index f542e946f1..0442b12c23 100644 --- a/src/battle/common/actor/medi_guy.inc.c +++ b/src/battle/common/actor/medi_guy.inc.c @@ -4,6 +4,8 @@ #include "script_api/battle.h" #include "sprite/npc/MediGuy.h" +#define NAMESPACE A(medi_guy) + extern EvtScript N(init); extern EvtScript N(takeTurn); extern EvtScript N(idle); @@ -149,67 +151,67 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim08) EVT_SET_CONST(LVar2, ANIM_MediGuy_Anim09) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim08) EVT_SET_CONST(LVar2, ANIM_MediGuy_Anim09) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -221,22 +223,22 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(returnHome)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim03) EVT_SET_CONST(LVar2, ANIM_MediGuy_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MediGuy_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/monty_mole.inc.c b/src/battle/common/actor/monty_mole.inc.c index 22bdf201ca..fec99772e0 100644 --- a/src/battle/common/actor/monty_mole.inc.c +++ b/src/battle/common/actor/monty_mole.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/MontyMole.h" +#define NAMESPACE A(monty_mole) + extern s32 N(IdleAnimations)[]; extern s32 N(IdleAnimations2)[]; extern EvtScript N(init); @@ -197,9 +198,9 @@ Formation N(formation_hole_2) = { EvtScript N(makeHole) = { EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_hole_2)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_hole_2)), FALSE) EVT_ELSE - EVT_CALL(SummonEnemy, EVT_PTR(N(formation_hole_1)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(formation_hole_1)), FALSE) EVT_END_IF EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) EVT_SUB(LVar3, 1) @@ -235,29 +236,29 @@ EvtScript N(handleEvent) = { EVT_WAIT(8) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim07) EVT_END_CHILD_THREAD - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim08) EVT_WAIT(10) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Anim05) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Anim0A) EVT_SET_CONST(LVar2, ANIM_MontyMole_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Anim0A) EVT_SET_CONST(LVar2, ANIM_MontyMole_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(makeHole)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -276,19 +277,19 @@ EvtScript N(handleEvent) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim14) EVT_WAIT(20) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Anim05) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim06) EVT_WAIT(10) EVT_EXEC_WAIT(N(makeHole)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Anim09) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -310,7 +311,7 @@ EvtScript N(handleEvent) = { EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_hole))) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_MontyMole_Anim05) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) diff --git a/src/battle/common/actor/paragloomba.inc.c b/src/battle/common/actor/paragloomba.inc.c new file mode 100644 index 0000000000..eba03276ad --- /dev/null +++ b/src/battle/common/actor/paragloomba.inc.c @@ -0,0 +1,933 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Paragoomba.h" +#include "sprite/npc/Goomba.h" +#include "effects.h" + +#define NAMESPACE A(paragloomba) + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); +extern EvtScript N(fall); +extern EvtScript N(init_gloomba); +extern EvtScript N(takeTurn_gloomba); +extern EvtScript N(idle_gloomba); +extern EvtScript N(handleEvent_gloomba); + +extern s32 N(IdleAnimations_gloomba)[]; +extern s32 N(IdleAnimations)[]; +extern s32 N(IdleAnimations_left_wing)[]; +extern s32 N(IdleAnimations_right_wing)[]; + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, + PRT_4 = 4, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(defenseTable2)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_gloomba)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 100, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 80, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 100, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 80, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 80, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 80, + STATUS_KEY_STATIC, 80, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 80, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 20 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_gloomba), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(defenseTable2), + .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -16, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_left_wing), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_4, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -16, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_right_wing), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_PARAGLOOMBA, + .level = 11, + .maxHP = 7, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 65, + .airLiftChance = 95, + .hurricaneChance = 90, + .spookChance = 80, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 36, 26 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Dark_Idle, + STATUS_KEY_STONE, ANIM_Paragoomba_Dark_Still, + STATUS_KEY_SLEEP, ANIM_Paragoomba_Dark_Sleep, + STATUS_KEY_POISON, ANIM_Paragoomba_Dark_Idle, + STATUS_KEY_STOP, ANIM_Paragoomba_Dark_Still, + STATUS_KEY_STATIC, ANIM_Paragoomba_Dark_Idle, + STATUS_KEY_PARALYZE, ANIM_Paragoomba_Dark_Still, + STATUS_KEY_DIZZY, ANIM_Paragoomba_Dark_Dizzy, + STATUS_KEY_FEAR, ANIM_Paragoomba_Dark_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_step)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Dark_Run, + STATUS_KEY_STONE, ANIM_Paragoomba_Dark_Still, + STATUS_KEY_SLEEP, ANIM_Paragoomba_Dark_Sleep, + STATUS_KEY_POISON, ANIM_Paragoomba_Dark_Idle, + STATUS_KEY_STOP, ANIM_Paragoomba_Dark_Still, + STATUS_KEY_STATIC, ANIM_Paragoomba_Dark_Run, + STATUS_KEY_PARALYZE, ANIM_Paragoomba_Dark_Still, + STATUS_KEY_DIZZY, ANIM_Paragoomba_Dark_Dizzy, + STATUS_KEY_FEAR, ANIM_Paragoomba_Dark_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_left_wing)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Dark_LWingStill, + STATUS_END, +}; + +s32 N(IdleAnimations_right_wing)[] = { + STATUS_KEY_NORMAL, ANIM_Paragoomba_Dark_RWingStill, + STATUS_END, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_LABEL(10) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_step))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations))) + EVT_LOOP(40) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_GOTO(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(returnHome) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Idle) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(GetEncounterTrigger, LVar0) + EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) + EVT_EXEC_WAIT(N(fall)) + EVT_END_IF + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_FALL_TRIGGER) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_EXEC_WAIT(N(fall)) + EVT_CASE_EQ(EVENT_15) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_EXEC_WAIT(N(fall)) + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dizzy) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_STAR_BEAM) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) + EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) + EVT_CALL(HPBarToCurrent, ACTOR_SELF) + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Run) + EVT_SET_CONST(LVar2, ANIM_Paragoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_Paragoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, EASING_LINEAR) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 2, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) + EVT_CALL(SetBattleCamZoom, 300) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dive) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_SUB(LVar0, 80) + EVT_SET(LVar1, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dive) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) + EVT_THREAD + EVT_LOOP(4) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DF) + EVT_WAIT(4) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Miss) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(3.0)) + EVT_WAIT(10) + EVT_IF_EQ(LVarA, 5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_WAIT(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_66) + EVT_CALL(SetBattleCamZoom, 300) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dive) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Dive) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) + EVT_END_SWITCH + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_WAIT(5) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dark_Run) + EVT_EXEC_WAIT(N(returnHome)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/StartRumbleWithParams.inc.c" + +EvtScript N(fall) = { + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_3, -9, 7, -2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_4, 11, 7, -2) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar0, EVENT_15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_BurnStill) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Hurt) + EVT_END_IF + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 100, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.3)) + EVT_END_THREAD + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar3) + EVT_IF_EQ(LVar3, 15) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Hurt) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_ADD(LVar4, 10) + EVT_ADD(LVar5, 5) + EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar3, LVar4, LVar5, EVT_FLOAT(1.0), 10, 0) + EVT_END_IF + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_LOOP(10) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_WAIT(1) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) + EVT_MOD(LVar0, 4) + EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_gloomba))) + EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_GLOOMBA) + EVT_EXEC_WAIT(N(init_gloomba)) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_RETURN + EVT_END +}; + +s32 N(IdleAnimations_gloomba)[] = { + STATUS_KEY_NORMAL, ANIM_Goomba_Dark_Idle, + STATUS_KEY_STONE, ANIM_Goomba_Dark_Still, + STATUS_KEY_SLEEP, ANIM_Goomba_Dark_Sleep, + STATUS_KEY_POISON, ANIM_Goomba_Dark_Idle, + STATUS_KEY_STOP, ANIM_Goomba_Dark_Still, + STATUS_KEY_STATIC, ANIM_Goomba_Dark_Idle, + STATUS_KEY_PARALYZE, ANIM_Goomba_Dark_Still, + STATUS_KEY_DIZZY, ANIM_Goomba_Dark_Dizzy, + STATUS_KEY_FEAR, ANIM_Goomba_Dark_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_gloomba_step)[] = { + STATUS_KEY_NORMAL, ANIM_Goomba_Dark_Run, + STATUS_KEY_STONE, ANIM_Goomba_Dark_Still, + STATUS_KEY_SLEEP, ANIM_Goomba_Dark_Sleep, + STATUS_KEY_POISON, ANIM_Goomba_Dark_Idle, + STATUS_KEY_STOP, ANIM_Goomba_Dark_Still, + STATUS_KEY_STATIC, ANIM_Goomba_Dark_Run, + STATUS_KEY_PARALYZE, ANIM_Goomba_Dark_Still, + STATUS_KEY_DIZZY, ANIM_Goomba_Dark_Dizzy, + STATUS_KEY_FEAR, ANIM_Goomba_Dark_Dizzy, + STATUS_END, +}; + +EvtScript N(init_gloomba) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_gloomba))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_gloomba))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_gloomba))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_gloomba) = { + EVT_LABEL(10) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_gloomba_step))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_gloomba))) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_gloomba_step))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_gloomba))) + EVT_LOOP(80) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_GOTO(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_gloomba) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Dizzy) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_STAR_BEAM) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Dead) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Run) + EVT_SET_CONST(LVar2, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_Goomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/CalculateArcsinDeg.inc.c" + +EvtScript N(takeTurn_gloomba) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 10) + EVT_ADD(LVar2, 3) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Sleep) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Hurt) + EVT_WAIT(5) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_THREAD + EVT_WAIT(4) + EVT_SET(LVar0, 180) + EVT_LOOP(4) + EVT_SUB(LVar0, 45) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Dizzy) + EVT_WAIT(5) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Tense) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_END_SWITCH + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Idle) + EVT_WAIT(3) + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dark_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/paragoomba.inc.c b/src/battle/common/actor/paragoomba.inc.c index eac61434cc..6027ef28cd 100644 --- a/src/battle/common/actor/paragoomba.inc.c +++ b/src/battle/common/actor/paragoomba.inc.c @@ -5,24 +5,42 @@ #include "sprite/npc/Goomba.h" #include "sprite/npc/Paragoomba.h" +#define NAMESPACE A(paragoomba) + +extern s32 N(DefaultAnims)[]; +extern s32 N(LeftWingAnims)[]; +extern s32 N(RightWingAnims)[]; +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_KnockDown); + +extern s32 A(downed_goomba_DefaultAnims)[]; +extern EvtScript A(downed_goomba_EVS_Init); + enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, + PRT_MAIN = 1, // body after being downed (must use same name as Goomba part #1) + PRT_FLYING = 2, // body while flying + PRT_DUMMY_WING_L = 3, // temporary wing while being downed + PRT_DUMMY_WING_R = 4, // temporary wing while being downed }; -s32 N(DefenseTable_8021B110)[] = { +enum N(ActorParams) { + DMG_AIR_KICK = 1, +}; + +s32 N(DownedDefense)[] = { ELEMENT_NORMAL, 0, ELEMENT_END, }; -s32 N(DefenseTable_8021B11C)[] = { +s32 N(FlyingDefense)[] = { ELEMENT_NORMAL, 0, ELEMENT_END, }; -s32 N(StatusTable_8021B128)[] = { +s32 N(DownedStatusTable)[] = { STATUS_KEY_NORMAL, 0, STATUS_KEY_DEFAULT, 0, STATUS_KEY_SLEEP, 100, @@ -47,7 +65,7 @@ s32 N(StatusTable_8021B128)[] = { STATUS_END, }; -s32 N(StatusTable_8021B1D4)[] = { +s32 N(FlyingStatusTable)[] = { STATUS_KEY_NORMAL, 0, STATUS_KEY_DEFAULT, 0, STATUS_KEY_SLEEP, 100, @@ -72,12 +90,6 @@ s32 N(StatusTable_8021B1D4)[] = { STATUS_END, }; -extern s32 N(IdleAnimations_8021CAFC)[]; -extern s32 N(IdleAnimations_8021B338)[]; -extern s32 N(IdleAnimations_8021B3D0)[]; -extern s32 N(IdleAnimations_8021B3DC)[]; -extern EvtScript N(init_8021B3E8); - ActorPartBlueprint N(ActorParts)[] = { { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, @@ -85,44 +97,44 @@ ActorPartBlueprint N(ActorParts)[] = { .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 20 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_8021CAFC), - .defenseTable = N(DefenseTable_8021B110), + .idleAnimations = A(downed_goomba_DefaultAnims), + .defenseTable = N(DownedDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, -10 }, }, { .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, + .index = PRT_FLYING, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 24 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_8021B338), - .defenseTable = N(DefenseTable_8021B11C), + .idleAnimations = N(DefaultAnims), + .defenseTable = N(FlyingDefense), .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, -10 }, }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_3, + .index = PRT_DUMMY_WING_L, .posOffset = { 0, 0, 0 }, .targetOffset = { -16, 24 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_8021B3D0), - .defenseTable = N(DefenseTable_8021B110), + .idleAnimations = N(LeftWingAnims), + .defenseTable = N(DownedDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, -10 }, }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_4, + .index = PRT_DUMMY_WING_R, .posOffset = { 0, 0, 0 }, .targetOffset = { -16, 24 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_8021B3DC), - .defenseTable = N(DefenseTable_8021B110), + .idleAnimations = N(RightWingAnims), + .defenseTable = N(DownedDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, -10 }, @@ -136,8 +148,8 @@ ActorBlueprint NAMESPACE = { .maxHP = 2, .partCount = ARRAY_COUNT( N(ActorParts)), .partsData = N(ActorParts), - .initScript = &N(init_8021B3E8), - .statusTable = N(StatusTable_8021B1D4), + .initScript = &N(EVS_Init), + .statusTable = N(FlyingStatusTable), .escapeChance = 90, .airLiftChance = 100, .hurricaneChance = 100, @@ -152,7 +164,7 @@ ActorBlueprint NAMESPACE = { .statusTextOffset = { 10, 20 }, }; -s32 N(IdleAnimations_8021B338)[] = { +s32 N(DefaultAnims)[] = { STATUS_KEY_NORMAL, ANIM_Paragoomba_Idle, STATUS_KEY_STONE, ANIM_Paragoomba_Still, STATUS_KEY_SLEEP, ANIM_Paragoomba_Sleep, @@ -165,7 +177,7 @@ s32 N(IdleAnimations_8021B338)[] = { STATUS_END, }; -s32 N(IdleAnimations_8021B384)[] = { +s32 N(ShuffleAnims)[] = { STATUS_KEY_NORMAL, ANIM_Paragoomba_Run, STATUS_KEY_STONE, ANIM_Paragoomba_Still, STATUS_KEY_SLEEP, ANIM_Paragoomba_Sleep, @@ -178,145 +190,139 @@ s32 N(IdleAnimations_8021B384)[] = { STATUS_END, }; -s32 N(IdleAnimations_8021B3D0)[] = { +s32 N(LeftWingAnims)[] = { STATUS_KEY_NORMAL, ANIM_Paragoomba_LWingStill, STATUS_END, }; -s32 N(IdleAnimations_8021B3DC)[] = { +s32 N(RightWingAnims)[] = { STATUS_KEY_NORMAL, ANIM_Paragoomba_RWingStill, STATUS_END, }; -extern EvtScript N(takeTurn_8021BD5C); -extern EvtScript N(idle_8021B434); -extern EvtScript N(handleEvent_8021B768); - -EvtScript N(init_8021B3E8) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021BD5C))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021B434))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021B768))) +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) EVT_RETURN EVT_END }; -EvtScript N(idle_8021B434) = { +EvtScript N(EVS_Idle) = { EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021B384))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_FLYING, EVT_PTR(N(ShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021B338))) - EVT_LOOP(40) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_FLYING, EVT_PTR(N(DefaultAnims))) + EVT_LOOP(40) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) + EVT_END_LOOP + EVT_GOTO(10) EVT_RETURN EVT_END }; -EvtScript N(8021B6F0) = { +EvtScript N(EVS_Paragoomba_GoHome) = { EVT_CALL(ResetAllActorSounds, ACTOR_SELF) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Idle) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Idle) EVT_RETURN EVT_END }; -extern EvtScript N(8021C574); - -EvtScript N(handleEvent_8021B768) = { +EvtScript N(EVS_HandleEvent) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(GetBattlePhase, LVar0) - EVT_IF_EQ(LVar0, 1) - EVT_CALL(GetEncounterState, LVar0) - EVT_IF_EQ(LVar0, 4) - EVT_EXEC_WAIT(N(8021C574)) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(GetEncounterTrigger, LVar0) + EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) + EVT_EXEC_WAIT(N(EVS_KnockDown)) EVT_END_IF EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnHurt) EVT_SET_CONST(LVar2, ANIM_Paragoomba_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnHurt) EVT_SET_CONST(LVar2, ANIM_Paragoomba_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_FALL_TRIGGER) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_EXEC_WAIT(N(8021C574)) + EVT_EXEC_WAIT(N(EVS_KnockDown)) EVT_CASE_EQ(EVENT_15) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_BurnHurt) EVT_SET_CONST(LVar2, ANIM_Paragoomba_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(8021C574)) + EVT_EXEC_WAIT(N(EVS_KnockDown)) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dizzy) - EVT_EXEC_WAIT(N(8021B6F0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Dizzy) + EVT_EXEC_WAIT(N(EVS_Paragoomba_GoHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -324,16 +330,16 @@ EvtScript N(handleEvent_8021B768) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -341,26 +347,26 @@ EvtScript N(handleEvent_8021B768) = { EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) EVT_CALL(HPBarToCurrent, ACTOR_SELF) EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) - EVT_EXEC_WAIT(N(8021B6F0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Run) + EVT_EXEC_WAIT(N(EVS_Paragoomba_GoHome)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Run) EVT_SET_CONST(LVar2, ANIM_Paragoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_Paragoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -372,7 +378,7 @@ EvtScript N(handleEvent_8021B768) = { EVT_END }; -EvtScript N(takeTurn_8021BD5C) = { +EvtScript N(EVS_TakeTurn) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) @@ -380,7 +386,7 @@ EvtScript N(takeTurn_8021BD5C) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) EVT_CALL(BattleCamTargetActor, ACTOR_SELF) EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Run) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) @@ -399,7 +405,7 @@ EvtScript N(takeTurn_8021BD5C) = { EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Dive) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) @@ -410,7 +416,7 @@ EvtScript N(takeTurn_8021BD5C) = { EVT_SET(LVar1, 20) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Dive) EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT) EVT_THREAD EVT_LOOP(4) @@ -418,23 +424,23 @@ EvtScript N(takeTurn_8021BD5C) = { EVT_WAIT(4) EVT_END_LOOP EVT_END_THREAD - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Miss) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(3.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Miss) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_FLYING, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_FLYING, EVT_FLOAT(3.0)) EVT_WAIT(10) EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) EVT_END_IF EVT_WAIT(10) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_2, EVT_FLOAT(1.0)) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_FLYING, EVT_FLOAT(1.0)) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Run) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(8021B6F0)) + EVT_EXEC_WAIT(N(EVS_Paragoomba_GoHome)) EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_FLYING, 0) EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_RETURN @@ -449,7 +455,7 @@ EvtScript N(takeTurn_8021BD5C) = { EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Dive) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE) @@ -457,11 +463,11 @@ EvtScript N(takeTurn_8021BD5C) = { EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Dive) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Dive) EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) EVT_END_SWITCH EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_AIR_KICK, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_HIT) EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) @@ -469,13 +475,13 @@ EvtScript N(takeTurn_8021BD5C) = { EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Run) EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) EVT_WAIT(5) EVT_CALL(YieldTurn) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_Paragoomba_Run) - EVT_EXEC_WAIT(N(8021B6F0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_Paragoomba_Run) + EVT_EXEC_WAIT(N(EVS_Paragoomba_GoHome)) EVT_END_CASE_GROUP EVT_END_SWITCH EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) @@ -484,21 +490,19 @@ EvtScript N(takeTurn_8021BD5C) = { EVT_END }; -extern EvtScript N(8021CB94); - #include "common/StartRumbleWithParams.inc.c" -EvtScript N(8021C574) = { +EvtScript N(EVS_KnockDown) = { EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_FLYING, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_DUMMY_WING_L, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_DUMMY_WING_R, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_3, -9, 7, -2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_4, 11, 7, -2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_DUMMY_WING_L, LVar0, LVar1, LVar2) + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_DUMMY_WING_L, -9, 7, -2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_DUMMY_WING_R, LVar0, LVar1, LVar2) + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_DUMMY_WING_R, 11, 7, -2) EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_IF_EQ(LVar0, EVENT_15) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_BurnStill) @@ -529,15 +533,15 @@ EvtScript N(8021C574) = { EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_LOOP(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WING_L, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WING_R, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WING_L, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WING_R, ACTOR_PART_FLAG_INVISIBLE, FALSE) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WING_L, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WING_R, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar0) EVT_MOD(LVar0, 4) EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) @@ -545,9 +549,9 @@ EvtScript N(8021C574) = { EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_8021B128))) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(DownedStatusTable))) EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_GOOMBA) - EVT_EXEC_WAIT(N(8021CB94)) + EVT_EXEC_WAIT(A(downed_goomba_EVS_Init)) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) @@ -555,384 +559,7 @@ EvtScript N(8021C574) = { EVT_END }; -// Copy of goomba.c follows.................. -// TODO: deduplicate - -s32 N(IdleAnimations_8021CAFC)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Idle, - STATUS_KEY_STONE, ANIM_Goomba_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Idle, - STATUS_KEY_PARALYZE, ANIM_Goomba_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Dizzy, - STATUS_END, -}; - -s32 N(IdleAnimations_8021CB48)[] = { - STATUS_KEY_NORMAL, ANIM_Goomba_Run, - STATUS_KEY_STONE, ANIM_Goomba_Still, - STATUS_KEY_SLEEP, ANIM_Goomba_Sleep, - STATUS_KEY_POISON, ANIM_Goomba_Idle, - STATUS_KEY_STOP, ANIM_Goomba_Still, - STATUS_KEY_STATIC, ANIM_Goomba_Run, - STATUS_KEY_PARALYZE, ANIM_Goomba_Still, - STATUS_KEY_DIZZY, ANIM_Goomba_Dizzy, - STATUS_KEY_FEAR, ANIM_Goomba_Dizzy, - STATUS_END, -}; - -extern EvtScript N(takeTurn_8021D6E8); -extern EvtScript N(idle_8021CBE0); -extern EvtScript N(handleEvent_8021CEBC); - -EvtScript N(8021CB94) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021D6E8))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021CBE0))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021CEBC))) - EVT_RETURN - EVT_END -}; - -EvtScript N(idle_8021CBE0) = { - EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021CB48))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021CAFC))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021CB48))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021CAFC))) - EVT_LOOP(80) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) - EVT_RETURN - EVT_END -}; - -EvtScript N(handleEvent_8021CEBC) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(EVENT_HIT_COMBO) - EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_BurnHurt) - EVT_SET_CONST(LVar2, ANIM_Goomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_BurnStill) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dizzy) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Electrocute) - EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_STAR_BEAM) - EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) - EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Idle) - EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) - EVT_END_CASE_GROUP - EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Dead) - EVT_EXEC_WAIT(EVS_Enemy_Death) - EVT_RETURN - EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(HPBarToHome, ACTOR_SELF) - EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Idle) - EVT_EXEC_WAIT(EVS_Enemy_Recover) - EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Run) - EVT_SET_CONST(LVar2, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_ScareAway) - EVT_RETURN - EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Run) - EVT_EXEC_WAIT(EVS_Enemy_AirLift) - EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) - EVT_SET_CONST(LVar1, ANIM_Goomba_Hurt) - EVT_EXEC_WAIT(EVS_Enemy_BlowAway) - EVT_RETURN - EVT_CASE_DEFAULT - EVT_END_SWITCH - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; - -#include "common/CalculateArcsinDeg.inc.c" - -EvtScript N(takeTurn_8021D6E8) = { - EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) - EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) - EVT_CALL(BattleCamTargetActor, ACTOR_SELF) - EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Run) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) - EVT_WAIT(1) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_MISS) - EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) - EVT_SET(LVarA, LVar0) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 10) - EVT_SET(LVar1, 10) - EVT_ADD(LVar2, 3) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Sleep) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hurt) - EVT_WAIT(5) - EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) - EVT_END_IF - EVT_WAIT(5) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 20) - EVT_SET(LVar1, 0) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) - EVT_THREAD - EVT_WAIT(4) - EVT_SET(LVar0, 180) - EVT_LOOP(4) - EVT_SUB(LVar0, 45) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Dizzy) - EVT_WAIT(5) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(YieldTurn) - EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_WAIT(5) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) - EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END_CASE_GROUP - EVT_CASE_DEFAULT - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) - EVT_THREAD - EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) - EVT_SET(LVar0, 0) - EVT_LOOP(16) - EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) - EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_SET(LVar1, LVar4) - EVT_SET(LVar2, LVar5) - EVT_SET(LVar3, LVar6) - EVT_WAIT(1) - EVT_END_LOOP - EVT_END_THREAD - EVT_THREAD - EVT_WAIT(6) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Midair) - EVT_END_THREAD - EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Tense) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_END_SWITCH - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(HIT_RESULT_HIT) - EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) - EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_WAIT(1) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 40) - EVT_SET(LVar1, 0) - EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 30) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) - EVT_ADD(LVar0, 20) - EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Idle) - EVT_WAIT(3) - EVT_CALL(YieldTurn) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Run) - EVT_CALL(SetGoalToHome, ACTOR_SELF) - EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) - EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_END_CASE_GROUP - EVT_END_SWITCH - EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) - EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) - EVT_RETURN - EVT_END -}; +// downed paragoombas are handled via a special nested goomba import +#define NESTED_ACTOR_INCLUDE 1 +#define NAMESPACE A(downed_goomba) +#include "goomba.inc.c" diff --git a/src/battle/common/actor/paratroopa.inc.c b/src/battle/common/actor/paratroopa.inc.c index 473a94d76d..361a3428b4 100644 --- a/src/battle/common/actor/paratroopa.inc.c +++ b/src/battle/common/actor/paratroopa.inc.c @@ -5,18 +5,43 @@ #include "sprite/npc/KoopaTroopa.h" #include "sprite/npc/ParaTroopa.h" -extern s32 N(IdleAnimations_80220AA0)[]; -extern s32 N(IdleAnimations_8021ED00)[]; -extern s32 N(IdleAnimations_8021ED98)[]; -extern EvtScript N(init_8021EE0C); +#define NAMESPACE A(paratroopa) + +extern s32 N(DownedAnims)[]; +extern s32 N(FlyingAnims)[]; +extern s32 N(WingAnims)[]; +extern EvtScript N(EVS_Flying_Init); +extern EvtScript N(EVS_Flying_Idle); +extern EvtScript N(EVS_Flying_TakeTurn); +extern EvtScript N(EVS_Flying_HandleEvent); +extern EvtScript N(EVS_KnockDown); + +extern EvtScript N(EVS_Downed_Init); +extern EvtScript N(EVS_Downed_Idle); +extern EvtScript N(EVS_Downed_TakeTurn); +extern EvtScript N(EVS_Downed_HandleEvent); + +#include "common/StartRumbleWithParams.inc.c" +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, + PRT_DOWNED = 1, + PRT_FLYING = 2, + PRT_DUMMY_WINGS = 3, }; -s32 N(DefenseTable_8021EAD0)[] = { +enum N(ActorVars) { + AVAR_AerialFlip = 0, // TRUE if current hit should trigger a flip event when KnockDown is done + AVAR_IsFlipped = 8, + AVAR_FlippedTurns = 9, +}; + +enum N(ActorParams) { + DMG_AIR_TACKLE = 1, + DMG_SHELL_TOSS = 1, +}; + +s32 N(DownedDefense)[] = { ELEMENT_NORMAL, 1, ELEMENT_SMASH, 1, ELEMENT_JUMP, 1, @@ -25,17 +50,17 @@ s32 N(DefenseTable_8021EAD0)[] = { ELEMENT_END, }; -s32 N(DefenseTable_8021EAFC)[] = { +s32 N(FlyingDefense)[] = { ELEMENT_NORMAL, 1, ELEMENT_END, }; -s32 N(DefenseTable_8021EB08)[] = { +s32 N(FlippedDefense)[] = { ELEMENT_NORMAL, 0, ELEMENT_END, }; -s32 N(StatusTable_8021EB14)[] = { +s32 N(DownedStatusTable)[] = { STATUS_KEY_NORMAL, 0, STATUS_KEY_DEFAULT, 0, STATUS_KEY_SLEEP, 90, @@ -60,7 +85,7 @@ s32 N(StatusTable_8021EB14)[] = { STATUS_END, }; -s32 N(StatusTable_8021EBC0)[] = { +s32 N(FlyingStatusTable)[] = { STATUS_KEY_NORMAL, 0, STATUS_KEY_DEFAULT, 0, STATUS_KEY_SLEEP, 90, @@ -88,36 +113,36 @@ s32 N(StatusTable_8021EBC0)[] = { ActorPartBlueprint N(ActorParts)[] = { { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, + .index = PRT_DOWNED, .posOffset = { 0, 0, 0 }, .targetOffset = { -2, 36 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_80220AA0), - .defenseTable = N(DefenseTable_8021EAD0), + .idleAnimations = N(DownedAnims), + .defenseTable = N(DownedDefense), .eventFlags = ACTOR_EVENT_FLAG_FLIPABLE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, -7 }, }, { .flags = ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, + .index = PRT_FLYING, .posOffset = { 0, 0, 0 }, .targetOffset = { -4, 36 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_8021ED00), - .defenseTable = N(DefenseTable_8021EAFC), + .idleAnimations = N(FlyingAnims), + .defenseTable = N(FlyingDefense), .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE, .elementImmunityFlags = 0, .projectileTargetOffset = { 2, -14 }, }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_3, + .index = PRT_DUMMY_WINGS, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 32 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_8021ED98), - .defenseTable = N(DefenseTable_8021EAD0), + .idleAnimations = N(WingAnims), + .defenseTable = N(DownedDefense), .eventFlags = ACTOR_EVENT_FLAGS_NONE, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, -10 }, @@ -131,8 +156,8 @@ ActorBlueprint NAMESPACE = { .maxHP = 4, .partCount = ARRAY_COUNT( N(ActorParts)), .partsData = N(ActorParts), - .initScript = &N(init_8021EE0C), - .statusTable = N(StatusTable_8021EBC0), + .initScript = &N(EVS_Flying_Init), + .statusTable = N(FlyingStatusTable), .escapeChance = 60, .airLiftChance = 95, .hurricaneChance = 100, @@ -147,7 +172,7 @@ ActorBlueprint NAMESPACE = { .statusTextOffset = { 8, 30 }, }; -s32 N(IdleAnimations_8021ED00)[] = { +s32 N(FlyingAnims)[] = { STATUS_KEY_NORMAL, ANIM_ParaTroopa_Idle, STATUS_KEY_STONE, ANIM_ParaTroopa_Still, STATUS_KEY_SLEEP, ANIM_ParaTroopa_Sleep, @@ -160,7 +185,7 @@ s32 N(IdleAnimations_8021ED00)[] = { STATUS_END, }; -s32 N(IdleAnimations_8021ED4C)[] = { +s32 N(FlyingShuffleAnims)[] = { STATUS_KEY_NORMAL, ANIM_ParaTroopa_Idle, STATUS_KEY_STONE, ANIM_ParaTroopa_Still, STATUS_KEY_SLEEP, ANIM_ParaTroopa_Sleep, @@ -173,7 +198,7 @@ s32 N(IdleAnimations_8021ED4C)[] = { STATUS_END, }; -s32 N(IdleAnimations_8021ED98)[] = { +s32 N(WingAnims)[] = { STATUS_KEY_NORMAL, ANIM_ParaTroopa_WingsStill, STATUS_KEY_STONE, ANIM_ParaTroopa_Still, STATUS_KEY_SLEEP, ANIM_ParaTroopa_Sleep, @@ -186,207 +211,197 @@ s32 N(IdleAnimations_8021ED98)[] = { STATUS_END, }; -EvtScript N(nextTurn_8021EDE4) = { - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) +EvtScript N(EVS_Flying_HandlePhase) = { + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_AerialFlip, FALSE) EVT_RETURN EVT_END }; -extern EvtScript N(takeTurn_8021FA24); -extern EvtScript N(idle_8021EF5C); -extern EvtScript N(handleEvent_8021F2EC); - -EvtScript N(init_8021EE0C) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021FA24))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021EF5C))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021F2EC))) - EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_8021EDE4))) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) +EvtScript N(EVS_Flying_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_Flying_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Flying_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_Flying_HandleEvent))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(EVS_Flying_HandlePhase))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_AerialFlip, FALSE) EVT_RETURN EVT_END }; -#include "common/StartRumbleWithParams.inc.c" - -#include "common/battle/SetAbsoluteStatusOffsets.inc.c" - -EvtScript N(8021EE84) = { - EVT_IF_FLAG(LVar1, 0x00041000) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_2, 0, 25) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_2, 3, -6) +EvtScript N(EVS_Flying_UpdateTargetOffsets) = { + EVT_IF_FLAG(LVar1, STATUS_FLAG_DIZZY | STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_FLYING, 0, 25) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_FLYING, 3, -6) EVT_CALL(N(SetAbsoluteStatusOffsets), -19, 25, 4, 28) EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_2, -2, 36) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_2, 0, -7) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_FLYING, -2, 36) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_FLYING, 0, -7) EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 29, 8, 30) EVT_END_IF EVT_RETURN EVT_END }; -EvtScript N(idle_8021EF5C) = { +EvtScript N(EVS_Flying_Idle) = { EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(8021EE84)) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(EVS_Flying_UpdateTargetOffsets)) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021ED4C))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021ED00))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(8021EE84)) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_FLYING, EVT_PTR(N(FlyingShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(FlyingAnims))) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(EVS_Flying_UpdateTargetOffsets)) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021ED4C))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021ED00))) - EVT_LOOP(40) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(8021EE84)) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_FLYING, EVT_PTR(N(FlyingShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_FLYING, EVT_PTR(N(FlyingAnims))) + EVT_LOOP(40) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(EVS_Flying_UpdateTargetOffsets)) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) + EVT_END_LOOP + EVT_GOTO(10) EVT_RETURN EVT_END }; -EvtScript N(8021F26C) = { - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Run) +EvtScript N(EVS_FlyHome) = { + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Run) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Idle) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Idle) EVT_RETURN EVT_END }; -extern EvtScript N(802204DC); - -EvtScript N(handleEvent_8021F2EC) = { +EvtScript N(EVS_Flying_HandleEvent) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_SET_CONST(LVar0, 2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_AerialFlip, TRUE) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(GetEncounterState, LVar0) - EVT_IF_EQ(LVar0, 4) - EVT_EXEC_WAIT(N(802204DC)) + EVT_CALL(GetEncounterTrigger, LVar0) + EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) + EVT_EXEC_WAIT(N(EVS_KnockDown)) EVT_END_IF EVT_END_IF EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_BurnHurt) EVT_SET_CONST(LVar2, ANIM_ParaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_BurnHurt) EVT_SET_CONST(LVar2, ANIM_ParaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_FALL_TRIGGER) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) - EVT_EXEC_WAIT(N(802204DC)) + EVT_EXEC_WAIT(N(EVS_KnockDown)) EVT_CASE_EQ(EVENT_15) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_BurnHurt) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_EXEC_WAIT(N(802204DC)) + EVT_EXEC_WAIT(N(EVS_KnockDown)) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_EXEC_WAIT(N(8021F26C)) + EVT_EXEC_WAIT(N(EVS_FlyHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) - EVT_SET_CONST(LVar0, 2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_AerialFlip, TRUE) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_ShellEnter) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_ShellEnter) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(GetEncounterState, LVar0) - EVT_IF_EQ(LVar0, 4) - EVT_EXEC_WAIT(N(802204DC)) + EVT_CALL(GetEncounterTrigger, LVar0) + EVT_IF_EQ(LVar0, ENCOUNTER_TRIGGER_HAMMER) + EVT_EXEC_WAIT(N(EVS_KnockDown)) EVT_END_IF EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -394,25 +409,25 @@ EvtScript N(handleEvent_8021F2EC) = { EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) EVT_CALL(HPBarToCurrent, ACTOR_SELF) EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_EXEC_WAIT(N(8021F26C)) + EVT_EXEC_WAIT(N(EVS_FlyHome)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Run) EVT_SET_CONST(LVar2, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_FLYING) EVT_SET_CONST(LVar1, ANIM_ParaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -424,7 +439,7 @@ EvtScript N(handleEvent_8021F2EC) = { EVT_END }; -EvtScript N(takeTurn_8021FA24) = { +EvtScript N(EVS_Flying_TakeTurn) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) @@ -432,7 +447,7 @@ EvtScript N(takeTurn_8021FA24) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_05) EVT_CALL(BattleCamTargetActor, ACTOR_SELF) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Run) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Run) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(AddGoalPos, ACTOR_SELF, 40, 30, 0) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0)) @@ -446,7 +461,7 @@ EvtScript N(takeTurn_8021FA24) = { EVT_SET(LVarA, LVar0) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Windup) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Windup) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(AddGoalPos, ACTOR_SELF, 6, 6, 0) @@ -460,7 +475,7 @@ EvtScript N(takeTurn_8021FA24) = { EVT_SET(LVar1, 0) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(10.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_ShellDive) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_ShellDive) EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_SUB(LVar0, 30) @@ -485,13 +500,13 @@ EvtScript N(takeTurn_8021FA24) = { EVT_SUB(LVar0, 30) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Hurt) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Hurt) EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_SUB(LVar0, 30) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Hurt) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Hurt) EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) @@ -503,11 +518,11 @@ EvtScript N(takeTurn_8021FA24) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(YieldTurn) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_FLYING, 0, ACTOR_DECORATION_SWEAT) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_EXEC_WAIT(N(8021F26C)) + EVT_EXEC_WAIT(N(EVS_FlyHome)) EVT_CALL(SetActorYaw, ACTOR_SELF, 0) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_FLYING, 0) EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_RETURN @@ -515,7 +530,7 @@ EvtScript N(takeTurn_8021FA24) = { EVT_END_SWITCH EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E0) EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Windup) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Windup) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(AddGoalPos, ACTOR_SELF, 6, 6, 0) @@ -526,10 +541,10 @@ EvtScript N(takeTurn_8021FA24) = { EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_0, SOUND_0) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(10.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_ShellDive) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_ShellDive) EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, DMG_AIR_TACKLE, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_HIT) EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) @@ -537,7 +552,7 @@ EvtScript N(takeTurn_8021FA24) = { EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(AddGoalPos, ACTOR_SELF, 40, 30, 0) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_ShellHit) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_ShellHit) EVT_THREAD EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) EVT_SET(LVar0, 0) @@ -551,13 +566,13 @@ EvtScript N(takeTurn_8021FA24) = { EVT_END_LOOP EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, -10, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_ParaTroopa_Idle) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Idle) EVT_END_THREAD EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 30, EASING_LINEAR) EVT_WAIT(10) EVT_CALL(YieldTurn) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_EXEC_WAIT(N(8021F26C)) + EVT_EXEC_WAIT(N(EVS_FlyHome)) EVT_END_CASE_GROUP EVT_END_SWITCH EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) @@ -566,22 +581,20 @@ EvtScript N(takeTurn_8021FA24) = { EVT_END }; -extern EvtScript N(80220B84); - -EvtScript N(802204DC) = { - EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, 0, 0, 0) +EvtScript N(EVS_KnockDown) = { + EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_FLYING, 0, 0, 0) EVT_CALL(HideHealthBar, ACTOR_SELF) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) - EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_FLYING, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_DUMMY_WINGS, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_DOWNED, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_ADD(LVar1, 8) EVT_SUB(LVar2, 2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Hurt) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_DUMMY_WINGS, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_Hurt) EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) - EVT_IF_EQ(LVarA, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_AerialFlip, LVarA) + EVT_IF_FALSE(LVarA) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_SET(LVar1, 0) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) @@ -597,12 +610,12 @@ EvtScript N(802204DC) = { EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_LOOP(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WINGS, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WINGS, ACTOR_PART_FLAG_INVISIBLE, FALSE) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WINGS, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_ELSE EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_SET(LVar1, 0) @@ -611,12 +624,12 @@ EvtScript N(802204DC) = { EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) EVT_THREAD EVT_LOOP(10) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WINGS, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WINGS, ACTOR_PART_FLAG_INVISIBLE, FALSE) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_DUMMY_WINGS, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_END_THREAD EVT_CALL(N(StartRumbleWithParams), 150, 7) EVT_THREAD @@ -629,23 +642,26 @@ EvtScript N(802204DC) = { EVT_CALL(SetGoalToIndex, ACTOR_SELF, LVar0) EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Idle) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_Idle) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_8021EB14))) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(DownedStatusTable))) EVT_CALL(BindNextTurn, ACTOR_SELF, 0) - EVT_EXEC_WAIT(N(80220B84)) + EVT_EXEC_WAIT(N(EVS_Downed_Init)) EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_KOOPA_TROOPA) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_IF_NE(LVarA, 0) + EVT_IF_TRUE(LVarA) EVT_CALL(DispatchEvent, ACTOR_SELF, EVENT_FLIP_TRIGGER) EVT_END_IF EVT_RETURN EVT_END }; -s32 N(IdleAnimations_80220AA0)[] = { +// everything below this point is shared with Koopa Troopa, but not in a manner +// that can be cleanly separated + +s32 N(DownedAnims)[] = { STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Idle, STATUS_KEY_STONE, ANIM_KoopaTroopa_Still, STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Sleep, @@ -658,7 +674,7 @@ s32 N(IdleAnimations_80220AA0)[] = { STATUS_END, }; -s32 N(IdleAnimations_80220AEC)[] = { +s32 N(DownedShuffleAnims)[] = { STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Walk, STATUS_KEY_STONE, ANIM_KoopaTroopa_Still, STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Sleep, @@ -671,7 +687,7 @@ s32 N(IdleAnimations_80220AEC)[] = { STATUS_END, }; -s32 N(IdleAnimations_80220B38)[] = { +s32 N(DownedFlippedAnims)[] = { STATUS_KEY_NORMAL, ANIM_KoopaTroopa_ToppleStruggle, STATUS_KEY_STONE, ANIM_KoopaTroopa_ToppleStill, STATUS_KEY_SLEEP, ANIM_KoopaTroopa_ToppleSleep, @@ -684,123 +700,119 @@ s32 N(IdleAnimations_80220B38)[] = { STATUS_END, }; -extern EvtScript N(takeTurn_80221DAC); -extern EvtScript N(idle_80220D40); -extern EvtScript N(handleEvent_80221228); - -EvtScript N(80220B84) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80221DAC))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80220D40))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80221228))) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) +EvtScript N(EVS_Downed_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_Downed_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Downed_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_Downed_HandleEvent))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_IsFlipped, FALSE) EVT_RETURN EVT_END }; -EvtScript N(80220BE8) = { +EvtScript N(EVS_Downed_UpdateTargetOffsets) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_IF_FLAG(LVar1, 0x00041000) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_IF_FLAG(LVar1, STATUS_FLAG_SLEEP | STATUS_FLAG_DIZZY) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_DOWNED, -5, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_DOWNED, 0, 0) EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) EVT_ELSE - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_DOWNED, -4, 32) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_DOWNED, -1, -4) EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 32, 5, 32) EVT_END_IF EVT_CASE_EQ(1) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_DOWNED, -5, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_DOWNED, 0, 0) EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) EVT_END_SWITCH EVT_RETURN EVT_END }; -EvtScript N(idle_80220D40) = { +EvtScript N(EVS_Downed_Idle) = { EVT_LABEL(0) - EVT_CALL(RandInt, 80, LVarA) - EVT_ADD(LVarA, 80) - EVT_LOOP(LVarA) - EVT_LABEL(1) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(80220BE8)) - EVT_IF_EQ(LVar0, 1) + EVT_CALL(RandInt, 80, LVarA) + EVT_ADD(LVarA, 80) + EVT_LOOP(LVarA) + EVT_LABEL(1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(EVS_Downed_UpdateTargetOffsets)) + EVT_IF_EQ(LVar0, 1) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(DownedShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(DownedAnims))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(DownedFlippedAnims))) + EVT_END_SWITCH + EVT_LOOP(20) + EVT_LABEL(2) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(EVS_Downed_UpdateTargetOffsets)) + EVT_IF_EQ(LVar0, 1) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220AEC))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220AA0))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220B38))) - EVT_END_SWITCH - EVT_LOOP(20) - EVT_LABEL(2) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(80220BE8)) - EVT_IF_EQ(LVar0, 1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(DownedShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(DownedAnims))) + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(DownedFlippedAnims))) + EVT_END_SWITCH + EVT_LOOP(80) + EVT_LABEL(3) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_EXEC_WAIT(N(EVS_Downed_UpdateTargetOffsets)) + EVT_IF_EQ(LVar0, 1) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(3) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220AEC))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_SWITCH(LVar0) - EVT_CASE_EQ(0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220AA0))) - EVT_CASE_EQ(1) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220B38))) - EVT_END_SWITCH - EVT_LOOP(80) - EVT_LABEL(3) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_EXEC_WAIT(N(80220BE8)) - EVT_IF_EQ(LVar0, 1) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) - EVT_WAIT(1) - EVT_GOTO(3) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(0) + EVT_END_LOOP + EVT_GOTO(0) EVT_RETURN EVT_END }; s32 N(FlipPosOffsets)[] = { 9, 16, 22, 26, 30, 32, 33, 32, 30, 26, 22, 16, 9, 0, 4, 6, 7, 6, 4, 0, 2, 0 }; -EvtScript N(handleEvent_80221228) = { +EvtScript N(EVS_Downed_HandleEvent) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetActorYaw, ACTOR_SELF, 0) @@ -808,45 +820,45 @@ EvtScript N(handleEvent_80221228) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_BurnHurt) EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_BurnHurt) EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_BurnStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) - EVT_CALL(SetActorVar, ACTOR_SELF, 9, 2) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_8021EB08))) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220B38))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_IsFlipped, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlippedTurns, 2) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(FlippedDefense))) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(DownedFlippedAnims))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_DOWNED, -5, 15) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_DOWNED, 0, 0) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Hurt) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_Hurt) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) EVT_CHILD_THREAD @@ -871,59 +883,59 @@ EvtScript N(handleEvent_80221228) = { EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ToppleStruggle) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_ToppleStruggle) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ShellEnter) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ShellExit) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_ShellExit) EVT_WAIT(10) EVT_END_IF EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_END_IF @@ -931,58 +943,58 @@ EvtScript N(handleEvent_80221228) = { EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Run) EVT_SET_CONST(LVar2, ANIM_KoopaTroopa_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Panic) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Panic) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_ToppleStruggle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF @@ -993,34 +1005,34 @@ EvtScript N(handleEvent_80221228) = { EVT_END }; -EvtScript N(takeTurn_80221DAC) = { +EvtScript N(EVS_Downed_TakeTurn) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ShellSpin) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_ShellSpin) EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_IsFlipped, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, 9, LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_FlippedTurns, LVar0) EVT_SUB(LVar0, 1) EVT_IF_GT(LVar0, 0) - EVT_CALL(SetActorVar, ACTOR_SELF, 9, LVar0) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(3.0)) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_FlippedTurns, LVar0) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_DOWNED, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_DOWNED, EVT_FLOAT(3.0)) EVT_WAIT(30) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_DOWNED, EVT_FLOAT(1.0)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_DOWNED, 0) EVT_ELSE - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(3.0)) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_DOWNED, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_DOWNED, EVT_FLOAT(3.0)) EVT_WAIT(20) - EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_DOWNED, EVT_FLOAT(1.0)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_DOWNED, 0) EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_JUMP_3E2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ToppleStruggle) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_ToppleStruggle) EVT_SET(LVar0, 0) EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0) EVT_CHILD_THREAD @@ -1038,12 +1050,12 @@ EvtScript N(takeTurn_80221DAC) = { EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Idle) - EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80220AA0))) - EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefenseTable_8021EAD0))) - EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32) - EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_Idle) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_IsFlipped, FALSE) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(DownedAnims))) + EVT_CALL(SetDefenseTable, ACTOR_SELF, PRT_DOWNED, EVT_PTR(N(DownedDefense))) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_DOWNED, -4, 32) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_DOWNED, -1, -4) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) EVT_END_IF @@ -1054,7 +1066,7 @@ EvtScript N(takeTurn_80221DAC) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) EVT_CALL(BattleCamTargetActor, ACTOR_SELF) EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ShellEnter) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_ShellEnter) EVT_WAIT(10) EVT_CHILD_THREAD EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) @@ -1066,7 +1078,7 @@ EvtScript N(takeTurn_80221DAC) = { EVT_PLAY_EFFECT(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) EVT_END_CHILD_THREAD EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2021) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ShellSpin) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_ShellSpin) EVT_WAIT(10) EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) EVT_END_IF @@ -1089,7 +1101,7 @@ EvtScript N(takeTurn_80221DAC) = { EVT_CALL(MoveBattleCamOver, 10) EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ShellExit) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_ShellExit) EVT_WAIT(8) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) @@ -1097,15 +1109,15 @@ EvtScript N(takeTurn_80221DAC) = { EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_BeginPanic1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_BeginPanic1) EVT_WAIT(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_BeginPanic2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_BeginPanic2) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_ADD(LVar1, 20) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Panic) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_Panic) EVT_WAIT(6) EVT_SUB(LVar1, 20) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) @@ -1113,14 +1125,14 @@ EvtScript N(takeTurn_80221DAC) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(YieldTurn) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) - EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Panic) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_DOWNED, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_Panic) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Idle) - EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetPartYaw, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_Idle) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_DOWNED, 0) + EVT_CALL(SetPartYaw, ACTOR_SELF, PRT_DOWNED, 0) EVT_CALL(SetActorYaw, ACTOR_SELF, 0) EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) @@ -1132,7 +1144,7 @@ EvtScript N(takeTurn_80221DAC) = { EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 1, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, DMG_SHELL_TOSS, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_HIT) EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) @@ -1149,13 +1161,13 @@ EvtScript N(takeTurn_80221DAC) = { EVT_ADD(LVar0, 20) EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_ShellExit) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_ShellExit) EVT_WAIT(8) EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_DOWNED) EVT_SET_CONST(LVar1, ANIM_KoopaTroopa_Run) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Idle) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_DOWNED, ANIM_KoopaTroopa_Idle) EVT_END_CASE_GROUP EVT_END_SWITCH EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) diff --git a/src/battle/common/actor/pink_shy_guy.inc.c b/src/battle/common/actor/pink_shy_guy.inc.c new file mode 100644 index 0000000000..eed0b4d2b2 --- /dev/null +++ b/src/battle/common/actor/pink_shy_guy.inc.c @@ -0,0 +1,497 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/ShyGuy.h" + +#define NAMESPACE A(pink_shy_guy) + +extern s32 N(IdleAnimations_8021E41C)[]; +extern EvtScript N(init_8021E468); +extern EvtScript N(takeTurn_8021FDB4); +extern EvtScript N(idle_8021E4B4); +extern EvtScript N(handleEvent_8021E628); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable_8021E310)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_SHOCK, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8021E324)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021E41C), + .defenseTable = N(DefenseTable_8021E310), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_SHY_GUY, + .level = 14, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021E468), + .statusTable = N(StatusTable_8021E324), + .escapeChance = 60, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 80, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 28, 24 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_8021E41C)[] = { + STATUS_KEY_NORMAL, ANIM_ShyGuy_Pink_Anim01, + STATUS_KEY_STONE, ANIM_ShyGuy_Pink_Anim00, + STATUS_KEY_SLEEP, ANIM_ShyGuy_Pink_Anim12, + STATUS_KEY_POISON, ANIM_ShyGuy_Pink_Anim01, + STATUS_KEY_STOP, ANIM_ShyGuy_Pink_Anim00, + STATUS_KEY_STATIC, ANIM_ShyGuy_Pink_Anim01, + STATUS_KEY_PARALYZE, ANIM_ShyGuy_Pink_Anim00, + STATUS_KEY_DIZZY, ANIM_ShyGuy_Pink_Anim13, + STATUS_KEY_FEAR, ANIM_ShyGuy_Pink_Anim13, + STATUS_END, +}; + +EvtScript N(init_8021E468) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021FDB4))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021E4B4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021E628))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_8021E4B4) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021E5C4) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021E628) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Pink_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Pink_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8021E5C4)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim03) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Pink_Anim14) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021EB04) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_WAIT(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_END_THREAD + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim05) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) + EVT_WAIT(8) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(8021E5C4)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021F22C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim09) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 80) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim09) + EVT_THREAD + EVT_WAIT(12) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim09) + EVT_THREAD + EVT_WAIT(9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) + EVT_SET(LVar3, 0) + EVT_LOOP(20) + EVT_SUB(LVar3, 30) + EVT_IF_LT(LVar3, 0) + EVT_ADD(LVar3, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim09) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim07) + EVT_WAIT(15) + EVT_GOTO(2) + EVT_LABEL(1) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim10) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 50) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim11) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim13) + EVT_END_IF + EVT_WAIT(25) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_LABEL(2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Pink_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Pink_Anim01) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021FDB4) = { + EVT_CALL(RandInt, 1, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_EXEC_WAIT(N(8021EB04)) + EVT_ELSE + EVT_EXEC_WAIT(N(8021F22C)) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/piranha_plant.inc.c b/src/battle/common/actor/piranha_plant.inc.c new file mode 100644 index 0000000000..37cb3d938a --- /dev/null +++ b/src/battle/common/actor/piranha_plant.inc.c @@ -0,0 +1,373 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/SmallPiranha.h" + +#define NAMESPACE A(piranha_plant) + +extern EvtScript N(init_8021D498); +extern EvtScript N(takeTurn_8021DCD4); +extern EvtScript N(idle_8021D4E4); +extern EvtScript N(handleEvent_8021D60C); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(IdleAnimations_8021D330)[] = { + STATUS_KEY_NORMAL, ANIM_SmallPiranha_Anim01, + STATUS_KEY_STONE, ANIM_SmallPiranha_Anim00, + STATUS_KEY_SLEEP, ANIM_SmallPiranha_Anim00, + STATUS_KEY_POISON, ANIM_SmallPiranha_Anim01, + STATUS_KEY_STOP, ANIM_SmallPiranha_Anim00, + STATUS_KEY_STATIC, ANIM_SmallPiranha_Anim01, + STATUS_KEY_PARALYZE, ANIM_SmallPiranha_Anim00, + STATUS_KEY_DIZZY, ANIM_SmallPiranha_Anim01, + STATUS_KEY_FEAR, ANIM_SmallPiranha_Anim01, + STATUS_END, +}; + +s32 N(unk_missing_8021D37C)[] = { + STATUS_KEY_NORMAL, ANIM_SmallPiranha_Anim01, + STATUS_END, +}; + +s32 N(unk_missing_8021D388)[] = { + STATUS_KEY_NORMAL, ANIM_SmallPiranha_Anim06, + STATUS_END, +}; + +s32 N(DefenseTable_8021D394)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8021D3A0)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 95, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 50, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 100, + STATUS_KEY_SHRINK, 80, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 35 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021D330), + .defenseTable = N(DefenseTable_8021D394), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_PIRANHA_PLANT, + .level = 11, + .maxHP = 5, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021D498), + .statusTable = N(StatusTable_8021D3A0), + .escapeChance = 70, + .airLiftChance = 20, + .hurricaneChance = 20, + .spookChance = 40, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 90, + .coinReward = 1, + .size = { 38, 38 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -7, 33 }, + .statusTextOffset = { 10, 33 }, +}; + +EvtScript N(init_8021D498) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021DCD4))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021D4E4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021D60C))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_8021D4E4) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(8021D4F4) = { + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim04) + EVT_WAIT(10) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim03) + EVT_WAIT(10) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021D60C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim0A) + EVT_SET_CONST(LVar2, ANIM_SmallPiranha_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim0A) + EVT_SET_CONST(LVar2, ANIM_SmallPiranha_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8021D4F4)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_SPIKE_TAUNT) + EVT_THREAD + EVT_WAIT(10) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, 0) + EVT_ADD(LVar1, 14) + EVT_ELSE + EVT_ADD(LVar0, 0) + EVT_ADD(LVar1, 35) + EVT_END_IF + EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) + EVT_WAIT(20) + EVT_END_THREAD + EVT_LOOP(40) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim01) + EVT_WAIT(1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim06) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim01) + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim04) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_WAIT(8) + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(RemoveActor, ACTOR_SELF) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SmallPiranha_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021DCD4) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim04) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 1) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_WAIT(15) + EVT_GOTO(123) + EVT_END_IF + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim04) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE) + EVT_WAIT(8) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_19) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetBattleCamTarget, LVar0, LVar1, LVar2) + EVT_CALL(SetBattleCamZoom, 350) + EVT_CALL(SetBattleCamOffsetZ, 45) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) + EVT_IF_FLAG(LVar5, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, 8) + EVT_ADD(LVar0, -3) + EVT_ELSE + EVT_ADD(LVar0, 20) + EVT_END_IF + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_0, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, FALSE, FALSE) + EVT_LABEL(123) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim03) + EVT_WAIT(8) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim05) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) + EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim06) + EVT_WAIT(2) + EVT_END_IF + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DE) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim07) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim08) + EVT_WAIT(2) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8021D4F4)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim06) + EVT_WAIT(2) + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DE) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim07) + EVT_WAIT(10) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_WAIT(2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SmallPiranha_Anim08) + EVT_WAIT(15) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(8021D4F4)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/pokey.inc.c b/src/battle/common/actor/pokey.inc.c index 3fd8a7f4ad..607cb55814 100644 --- a/src/battle/common/actor/pokey.inc.c +++ b/src/battle/common/actor/pokey.inc.c @@ -4,42 +4,59 @@ #include "script_api/battle.h" #include "sprite/npc/Pokey.h" +#define NAMESPACE A(pokey) + +// while these parts seem set up to manage Pokeys changing size, its actually all handled via animations +// and the PRT_BODY* are always invisible enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_2 = 2, - PRT_3 = 3, - PRT_4 = 4, - PRT_5 = 5, - PRT_6 = 6, + PRT_MAIN = 1, // top part of a 4-part Pokey + PRT_BODY3 = 2, // bottom part of a 4-part Pokey + PRT_BODY2 = 3, + PRT_BODY1 = 4, + PRT_SINGLE = 5, // single-part Pokey + PRT_PROJECTILE = 6, // part which is thrown }; enum N(ActorVars) { - N(VAR_PARTS_THROWN) = 0, - N(VAR_ANIM_IMMUNE) = 1, - N(VAR_ANIM_UNK) = 2, - N(VAR_ANIM_HIT) = 3, - N(VAR_ANIM_THROW1) = 4, - N(VAR_ANIM_THROW2) = 5, - N(VAR_ANIM_BURN) = 6, - N(VAR_ANIM_BURN2) = 7, - N(VAR_CANT_SUMMON) = 9, - N(VAR_SUMMON_COUNT) = 10, + AVAR_In_CantSummon = 1, + AVAR_PartsThrown = 0, + AVAR_Anim_Immune = 1, + AVAR_Anim_Run = 2, + AVAR_Anim_Hit = 3, + AVAR_Anim_Windup = 4, + AVAR_Anim_Throw = 5, + AVAR_Anim_BurnHurt = 6, + AVAR_Anim_BurnStill = 7, + AVAR_CantSummon = 9, + AVAR_Generation = 10, // Pokeys from the initial formation are generation 0, their summons are generation 1, and so on. generation 2 cannot summon. + + AVAL_Generation_First = 0, + AVAL_Generation_Second = 1, + AVAL_Generation_Last = 2, }; -extern s32 N(IdleAnimations)[]; -extern s32 N(IdleAnimations_thrownBodyPart)[]; -extern EvtScript N(init); -extern EvtScript N(takeTurn); -extern EvtScript N(idle); -extern EvtScript N(handleEvent); -extern EvtScript N(findPlaceForSummon); -extern EvtScript N(unearthFriend); -extern EvtScript N(attackHeadDive); -extern EvtScript N(onSpinSmash); -extern EvtScript N(afterPartThrown); -extern EvtScript N(doSpinSmashHit); -extern EvtScript N(onHit); -extern EvtScript N(flee); +enum N(ActorParams) { + DMG_SMASH_LARGE = 2, + DMG_SMASH_MEDIUM = 2, + DMG_SMASH_SMALL = 2, + DMG_THROW_PART = 2, // throw a body part at the player + DMG_LEAP = 2, // jump onto the player, used when no more parts can be thrown +}; + +extern s32 N(FourPartAnims)[]; +extern s32 N(ThrownPartAnims)[]; +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_FindValidSummonPosition); +extern EvtScript N(EVS_SummonBackup); +extern EvtScript N(EVS_Attack_SinglePartLeap); +extern EvtScript N(EVS_Pokey_SpinSmashHit); +extern EvtScript N(EVS_DecrementSize); +extern EvtScript N(EVS_KnockPartAway); +extern EvtScript N(EVS_Pokey_Hit); +extern EvtScript N(EVS_Pokey_ScareAway); s32 N(DefenseTable)[] = { ELEMENT_NORMAL, 0, @@ -78,7 +95,7 @@ ActorPartBlueprint N(ActorParts)[] = { .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 20 }, .opacity = 255, - .idleAnimations = N(IdleAnimations), + .idleAnimations = N(FourPartAnims), .defenseTable = N(DefenseTable), .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, .elementImmunityFlags = 0, @@ -86,7 +103,7 @@ ActorPartBlueprint N(ActorParts)[] = { }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_MULTI_TARGET, - .index = PRT_2, + .index = PRT_BODY3, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 72 }, .opacity = 255, @@ -98,7 +115,7 @@ ActorPartBlueprint N(ActorParts)[] = { }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_3, + .index = PRT_BODY2, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 54 }, .opacity = 255, @@ -110,7 +127,7 @@ ActorPartBlueprint N(ActorParts)[] = { }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_4, + .index = PRT_BODY1, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 36 }, .opacity = 255, @@ -122,7 +139,7 @@ ActorPartBlueprint N(ActorParts)[] = { }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_5, + .index = PRT_SINGLE, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 16 }, .opacity = 255, @@ -134,11 +151,11 @@ ActorPartBlueprint N(ActorParts)[] = { }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_6, + .index = PRT_PROJECTILE, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_thrownBodyPart), + .idleAnimations = N(ThrownPartAnims), .defenseTable = N(DefenseTable), .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, .elementImmunityFlags = 0, @@ -153,7 +170,7 @@ ActorBlueprint NAMESPACE = { .maxHP = 4, .partCount = ARRAY_COUNT(N(ActorParts)), .partsData = N(ActorParts), - .initScript = &N(init), + .initScript = &N(EVS_Init), .statusTable = N(StatusTable), .escapeChance = 70, .airLiftChance = 90, @@ -169,101 +186,102 @@ ActorBlueprint NAMESPACE = { .statusTextOffset = { 10, 65 }, }; -s32 N(IdleAnimations)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Anim04, - STATUS_KEY_STONE, ANIM_Pokey_Anim00, - STATUS_KEY_SLEEP, ANIM_Pokey_Anim25, - STATUS_KEY_STOP, ANIM_Pokey_Anim00, - STATUS_KEY_PARALYZE, ANIM_Pokey_Anim00, - STATUS_KEY_DIZZY, ANIM_Pokey_Anim21, - STATUS_KEY_FEAR, ANIM_Pokey_Anim21, +s32 N(FourPartAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Idle4, + STATUS_KEY_STONE, ANIM_Pokey_Still4, + STATUS_KEY_SLEEP, ANIM_Pokey_Sleep4, + STATUS_KEY_STOP, ANIM_Pokey_Still4, + STATUS_KEY_PARALYZE, ANIM_Pokey_Still4, + STATUS_KEY_DIZZY, ANIM_Pokey_Dizzy4, + STATUS_KEY_FEAR, ANIM_Pokey_Dizzy4, STATUS_END, }; -s32 N(IdleAnimations_3bodyParts)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Anim05, - STATUS_KEY_STONE, ANIM_Pokey_Anim01, - STATUS_KEY_SLEEP, ANIM_Pokey_Anim26, - STATUS_KEY_STOP, ANIM_Pokey_Anim01, - STATUS_KEY_PARALYZE, ANIM_Pokey_Anim01, - STATUS_KEY_DIZZY, ANIM_Pokey_Anim22, - STATUS_KEY_FEAR, ANIM_Pokey_Anim22, +s32 N(ThreePartAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Idle3, + STATUS_KEY_STONE, ANIM_Pokey_Still3, + STATUS_KEY_SLEEP, ANIM_Pokey_Sleep3, + STATUS_KEY_STOP, ANIM_Pokey_Still3, + STATUS_KEY_PARALYZE, ANIM_Pokey_Still3, + STATUS_KEY_DIZZY, ANIM_Pokey_Dizzy3, + STATUS_KEY_FEAR, ANIM_Pokey_Dizzy3, STATUS_END, }; -s32 N(IdleAnimations_2bodyParts)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Anim06, - STATUS_KEY_STONE, ANIM_Pokey_Anim02, - STATUS_KEY_SLEEP, ANIM_Pokey_Anim27, - STATUS_KEY_STOP, ANIM_Pokey_Anim02, - STATUS_KEY_PARALYZE, ANIM_Pokey_Anim02, - STATUS_KEY_DIZZY, ANIM_Pokey_Anim23, - STATUS_KEY_FEAR, ANIM_Pokey_Anim23, +s32 N(TwoPartAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Idle2, + STATUS_KEY_STONE, ANIM_Pokey_Still2, + STATUS_KEY_SLEEP, ANIM_Pokey_Sleep2, + STATUS_KEY_STOP, ANIM_Pokey_Still2, + STATUS_KEY_PARALYZE, ANIM_Pokey_Still2, + STATUS_KEY_DIZZY, ANIM_Pokey_Dizzy2, + STATUS_KEY_FEAR, ANIM_Pokey_Dizzy2, STATUS_END, }; -s32 N(IdleAnimations_1bodyPart)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Anim07, - STATUS_KEY_STONE, ANIM_Pokey_Anim03, - STATUS_KEY_SLEEP, ANIM_Pokey_Anim28, - STATUS_KEY_STOP, ANIM_Pokey_Anim03, - STATUS_KEY_PARALYZE, ANIM_Pokey_Anim03, - STATUS_KEY_DIZZY, ANIM_Pokey_Anim24, - STATUS_KEY_FEAR, ANIM_Pokey_Anim24, +s32 N(OnePartAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Idle1, + STATUS_KEY_STONE, ANIM_Pokey_Still1, + STATUS_KEY_SLEEP, ANIM_Pokey_Sleep1, + STATUS_KEY_STOP, ANIM_Pokey_Still1, + STATUS_KEY_PARALYZE, ANIM_Pokey_Still1, + STATUS_KEY_DIZZY, ANIM_Pokey_Dizzy1, + STATUS_KEY_FEAR, ANIM_Pokey_Dizzy1, STATUS_END, }; -s32 N(IdleAnimations_thrownBodyPart)[] = { - STATUS_KEY_NORMAL, ANIM_Pokey_Anim16, +s32 N(ThrownPartAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Projectile, STATUS_END, }; -EvtScript N(init) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_SUMMON_COUNT), 0) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_IMMUNE), LVar0) // from formation 'var1' setting - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_CANT_SUMMON), LVar0) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), 0) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_IMMUNE), ANIM_Pokey_Anim04) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_UNK), ANIM_Pokey_Anim08) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), ANIM_Pokey_Anim0C) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_THROW1), ANIM_Pokey_Anim10) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_THROW2), ANIM_Pokey_Anim11) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN), ANIM_Pokey_Anim18) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN2), ANIM_Pokey_Anim19) +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Generation, AVAL_Generation_First) + // copy input var from Formation + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_In_CantSummon, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_CantSummon, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Immune, ANIM_Pokey_Idle4) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Run, ANIM_Pokey_Run4) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Hit, ANIM_Pokey_Hurt4) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Windup, ANIM_Pokey_Windup3) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Throw, ANIM_Pokey_Throw3) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, ANIM_Pokey_BurnHurt4) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, ANIM_Pokey_BurnStill4) EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_RETURN EVT_END }; -EvtScript N(idle) = { +EvtScript N(EVS_Idle) = { EVT_RETURN EVT_END }; -EvtScript N(handleEvent) = { +EvtScript N(EVS_HandleEvent) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVarA) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA) EVT_IF_EQ(LVarA, 3) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE EVT_CALL(GetDamageSource, LVar0) @@ -271,11 +289,11 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) - EVT_EXEC_WAIT(N(onHit)) + EVT_EXEC_WAIT(N(EVS_Pokey_Hit)) EVT_END_CASE_GROUP EVT_CASE_DEFAULT - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_SWITCH EVT_END_IF @@ -283,15 +301,15 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_DEATH) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVarA) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA) EVT_IF_EQ(LVarA, 3) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) EVT_ELSE @@ -300,29 +318,29 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) - EVT_EXEC_WAIT(N(onHit)) + EVT_EXEC_WAIT(N(EVS_Pokey_Hit)) EVT_END_CASE_GROUP EVT_CASE_DEFAULT - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) EVT_END_SWITCH EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN), LVar1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN2), LVar2) - EVT_SET_CONST(LVar0, 1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar2) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVarA) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA) EVT_IF_EQ(LVarA, 3) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE @@ -331,7 +349,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) - EVT_EXEC_WAIT(N(onHit)) + EVT_EXEC_WAIT(N(EVS_Pokey_Hit)) EVT_END_CASE_GROUP EVT_CASE_DEFAULT EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -339,14 +357,14 @@ EvtScript N(handleEvent) = { EVT_END_IF EVT_END_IF EVT_CASE_OR_EQ(EVENT_BURN_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN), LVar1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN2), LVar2) - EVT_SET_CONST(LVar0, 1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar2) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVarA) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA) EVT_IF_EQ(LVarA, 3) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE @@ -355,53 +373,53 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) - EVT_EXEC_WAIT(N(onHit)) + EVT_EXEC_WAIT(N(EVS_Pokey_Hit)) EVT_END_CASE_GROUP EVT_CASE_DEFAULT EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_END_SWITCH EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN2), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_EXEC_WAIT(N(onSpinSmash)) + EVT_EXEC_WAIT(N(EVS_Pokey_SpinSmashHit)) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_EXEC_WAIT(N(onSpinSmash)) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_EXEC_WAIT(N(EVS_Pokey_SpinSmashHit)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_LAUNCH_HIT) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE - EVT_EXEC_WAIT(N(onHit)) + EVT_EXEC_WAIT(N(EVS_Pokey_Hit)) EVT_END_IF EVT_CASE_EQ(EVENT_SPIN_SMASH_LAUNCH_DEATH) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE - EVT_EXEC_WAIT(N(onHit)) + EVT_EXEC_WAIT(N(EVS_Pokey_Hit)) EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, -1) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_UNK), LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Run, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) @@ -410,38 +428,38 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(EVS_Enemy_HopToPos) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_IMMUNE), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Immune, LVar1) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SPIKE_TAUNT) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) EVT_SET(LVar0, 0) EVT_SET(LVar1, 77) - EVT_SET_CONST(LVar2, ANIM_Pokey_Anim21) + EVT_SET_CONST(LVar2, ANIM_Pokey_Dizzy4) EVT_CASE_EQ(1) EVT_SET(LVar0, 0) EVT_SET(LVar1, 59) - EVT_SET_CONST(LVar2, ANIM_Pokey_Anim22) + EVT_SET_CONST(LVar2, ANIM_Pokey_Dizzy3) EVT_CASE_EQ(2) EVT_SET(LVar0, 0) EVT_SET(LVar1, 41) - EVT_SET_CONST(LVar2, ANIM_Pokey_Anim23) + EVT_SET_CONST(LVar2, ANIM_Pokey_Dizzy2) EVT_CASE_EQ(3) EVT_SET(LVar0, 0) EVT_SET(LVar1, 23) - EVT_SET_CONST(LVar2, ANIM_Pokey_Anim24) + EVT_SET_CONST(LVar2, ANIM_Pokey_Dizzy1) EVT_END_SWITCH EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SLEEP) @@ -458,11 +476,11 @@ EvtScript N(handleEvent) = { EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar3, LVar4, LVar5, 20, 0) EVT_WAIT(30) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_IMMUNE), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Immune, LVar1) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_EXEC_WAIT(N(flee)) + EVT_EXEC_WAIT(N(EVS_Pokey_ScareAway)) EVT_RETURN EVT_CASE_DEFAULT EVT_END_SWITCH @@ -472,7 +490,7 @@ EvtScript N(handleEvent) = { EVT_END }; -EvtScript N(timberAttack) = { +EvtScript N(EVS_Attack_GroundSmash) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) @@ -480,7 +498,7 @@ EvtScript N(timberAttack) = { EVT_CALL(BattleCamTargetActor, ACTOR_SELF) EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) @@ -489,10 +507,10 @@ EvtScript N(timberAttack) = { EVT_ELSE EVT_CALL(AddGoalPos, ACTOR_SELF, 24, 0, 0) EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim08) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run4) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim04) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4) EVT_CASE_EQ(1) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) @@ -500,10 +518,10 @@ EvtScript N(timberAttack) = { EVT_ELSE EVT_CALL(AddGoalPos, ACTOR_SELF, 16, 0, 0) EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim09) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run3) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim05) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle3) EVT_CASE_EQ(2) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) @@ -511,32 +529,32 @@ EvtScript N(timberAttack) = { EVT_ELSE EVT_CALL(AddGoalPos, ACTOR_SELF, 8, 0, 0) EVT_END_IF - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim0A) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run2) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim06) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle2) EVT_END_SWITCH EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_342) EVT_CALL(MakeLerp, 0, -40, 20, EASING_COS_IN_OUT) EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF EVT_CHILD_THREAD EVT_WAIT(3) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2ED) EVT_END_CHILD_THREAD EVT_CALL(MakeLerp, -40, 90, 5, EASING_QUADRATIC_IN) EVT_LABEL(3) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(3) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(3) + EVT_END_IF EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 0, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_MISS) @@ -544,52 +562,53 @@ EvtScript N(timberAttack) = { EVT_SET(LVarA, LVar0) EVT_CALL(MakeLerp, 90, 0, 5, EASING_LINEAR) EVT_LABEL(4) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(4) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(4) + EVT_END_IF EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) EVT_END_IF EVT_CALL(YieldTurn) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim08) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run4) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim04) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4) EVT_CASE_EQ(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim09) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run3) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim05) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle3) EVT_CASE_EQ(2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim0A) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run2) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim06) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle2) EVT_END_SWITCH EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_RETURN EVT_END_SWITCH - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVar0) + // damage *could* depend on size of the Pokey, but all DMG values are the same, so it doesn't + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET(LVar1, 2) + EVT_SET(LVar1, DMG_SMASH_LARGE) EVT_CASE_EQ(1) - EVT_SET(LVar1, 2) + EVT_SET(LVar1, DMG_SMASH_MEDIUM) EVT_CASE_DEFAULT - EVT_SET(LVar1, 2) + EVT_SET(LVar1, DMG_SMASH_SMALL) EVT_END_SWITCH EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_WAIT(2) @@ -600,33 +619,33 @@ EvtScript N(timberAttack) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(MakeLerp, 90, 0, 10, EASING_LINEAR) EVT_LABEL(5) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(5) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(5) + EVT_END_IF EVT_CALL(YieldTurn) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim08) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run4) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim04) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4) EVT_CASE_EQ(1) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim09) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run3) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim05) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle3) EVT_CASE_EQ(2) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim0A) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run2) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim06) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle2) EVT_END_SWITCH EVT_END_CASE_GROUP EVT_END_SWITCH @@ -636,78 +655,82 @@ EvtScript N(timberAttack) = { EVT_END }; -EvtScript N(calcSummonChance) = { +// (out) LVar9 : number of Pokey actors that aren't disabled, haven't thrown parts, and aren't last-generation +EvtScript N(EVS_CountSummonerPokeys) = { EVT_SET(LVar9, 0) EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) EVT_CALL(InitTargetIterator) EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(GetOriginalActorType, LVar0, LVar2) - EVT_SWITCH(LVar2) - EVT_CASE_EQ(ACTOR_TYPE_POKEY) - EVT_CALL(GetStatusFlags, LVar0, LVar3) - EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED | STATUS_FLAG_SHRINK) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVar3) - EVT_IF_EQ(LVar3, 0) - EVT_CALL(GetActorVar, LVar0, N(VAR_SUMMON_COUNT), LVar3) - EVT_IF_NE(LVar3, 2) - EVT_ADD(LVar9, 1) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetOriginalActorType, LVar0, LVar2) + EVT_SWITCH(LVar2) + EVT_CASE_EQ(ACTOR_TYPE_POKEY) + EVT_CALL(GetStatusFlags, LVar0, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED | STATUS_FLAG_SHRINK) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar3) + EVT_IF_EQ(LVar3, 0) + EVT_CALL(GetActorVar, LVar0, AVAR_Generation, LVar3) + EVT_IF_NE(LVar3, AVAL_Generation_Last) + EVT_ADD(LVar9, 1) + EVT_END_IF EVT_END_IF EVT_END_IF - EVT_END_IF - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF EVT_RETURN EVT_END }; -EvtScript N(takeTurn) = { - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVarA) +EvtScript N(EVS_TakeTurn) = { + #define LBL_NO_SUMMON 123 + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA) EVT_IF_EQ(LVarA, 3) - EVT_EXEC_WAIT(N(attackHeadDive)) + EVT_EXEC_WAIT(N(EVS_Attack_SinglePartLeap)) EVT_RETURN EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_CANT_SUMMON), LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_CantSummon, LVar0) EVT_IF_EQ(LVar0, 0) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_SUMMON_COUNT), LVar0) - EVT_IF_EQ(LVar0, 2) - EVT_GOTO(123) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar0) + EVT_IF_EQ(LVar0, AVAL_Generation_Last) + EVT_GOTO(LBL_NO_SUMMON) EVT_END_IF - EVT_EXEC_WAIT(N(findPlaceForSummon)) + EVT_EXEC_WAIT(N(EVS_FindValidSummonPosition)) EVT_IF_EQ(LVarE, -1) - EVT_GOTO(123) + EVT_GOTO(LBL_NO_SUMMON) EVT_END_IF - EVT_EXEC_WAIT(N(calcSummonChance)) + EVT_EXEC_WAIT(N(EVS_CountSummonerPokeys)) EVT_SWITCH(LVar9) EVT_CASE_EQ(1) EVT_CALL(RandInt, 1000, LVar0) EVT_IF_LT(LVar0, 400) - EVT_EXEC_WAIT(N(unearthFriend)) + EVT_EXEC_WAIT(N(EVS_SummonBackup)) EVT_RETURN EVT_END_IF EVT_CASE_EQ(2) EVT_CALL(RandInt, 1000, LVar0) EVT_IF_LT(LVar0, 200) - EVT_EXEC_WAIT(N(unearthFriend)) + EVT_EXEC_WAIT(N(EVS_SummonBackup)) EVT_RETURN EVT_END_IF EVT_CASE_EQ(3) EVT_CALL(RandInt, 1000, LVar0) EVT_IF_LT(LVar0, 100) - EVT_EXEC_WAIT(N(unearthFriend)) + EVT_EXEC_WAIT(N(EVS_SummonBackup)) EVT_RETURN EVT_END_IF EVT_END_SWITCH EVT_END_IF - EVT_LABEL(123) + // try other moves + EVT_LABEL(LBL_NO_SUMMON) EVT_CALL(RandInt, 1000, LVar0) EVT_IF_LT(LVar0, 500) - EVT_EXEC_WAIT(N(timberAttack)) + EVT_EXEC_WAIT(N(EVS_Attack_GroundSmash)) EVT_RETURN EVT_END_IF + // throw a body part EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(GetBattlePhase, LVar0) @@ -715,61 +738,61 @@ EvtScript N(takeTurn) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(MoveBattleCamOver, 1) EVT_END_IF - EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_6, ACTOR_SOUND_JUMP, 0, 0) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_PROJECTILE, ACTOR_SOUND_JUMP, 0, 0) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) EVT_ELSE - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) EVT_END_IF EVT_CHILD_THREAD - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, FALSE) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(2.2)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Anim16) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(2.2)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_PROJECTILE, ANIM_Pokey_Projectile) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVarA) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA) EVT_SWITCH(LVarA) EVT_CASE_EQ(0) EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) EVT_ADD(LVar1, 38) EVT_ELSE EVT_ADD(LVar1, 15) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(1.2)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(1.2)) EVT_END_IF - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 15, TRUE) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 15, TRUE) EVT_CASE_EQ(1) EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) EVT_ADD(LVar1, 20) EVT_ELSE EVT_ADD(LVar1, 8) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(1.2)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(1.2)) EVT_END_IF - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 15, TRUE) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 15, TRUE) EVT_CASE_EQ(2) EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) EVT_ADD(LVar1, 8) EVT_ELSE EVT_ADD(LVar1, 3) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(1.2)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(1.2)) EVT_END_IF - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 15, TRUE) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 15, TRUE) EVT_CASE_EQ(3) EVT_END_SWITCH EVT_END_CHILD_THREAD EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_342) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_THROW1), LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Windup, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_WAIT(12) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_THROW2), LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Throw, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_WAIT(1) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2CE) EVT_WAIT(3) - EVT_EXEC_WAIT(N(afterPartThrown)) + EVT_EXEC_WAIT(N(EVS_DecrementSize)) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, DMG_THROW_PART, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_MISS) EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) @@ -784,12 +807,12 @@ EvtScript N(takeTurn) = { EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_SUB(LVar0, 80) EVT_SUB(LVar1, 5) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(20.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Anim16) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_UNK), LVar1) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(20.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(0.1)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_PROJECTILE, ANIM_Pokey_Projectile) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Run, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_RETURN EVT_END_CASE_GROUP @@ -797,12 +820,12 @@ EvtScript N(takeTurn) = { EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) EVT_CALL(SetGoalToTarget, ACTOR_SELF) EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(20.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Anim16) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 0), 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_UNK), LVar1) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(20.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(0.1)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_PROJECTILE, ANIM_Pokey_Projectile) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, TRUE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 0), DMG_THROW_PART, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Run, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_HIT) @@ -810,16 +833,16 @@ EvtScript N(takeTurn) = { EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) EVT_SUB(LVar0, 55) EVT_SET(LVar1, 0) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(4.0)) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(6.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(0.1)) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(4.0)) EVT_SUB(LVar0, 24) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(3.0)) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(3.0)) EVT_SUB(LVar0, 20) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 20, EASING_LINEAR) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, 20, EASING_LINEAR) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_END_CASE_GROUP EVT_END_SWITCH EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) @@ -828,16 +851,17 @@ EvtScript N(takeTurn) = { EVT_END }; -EvtScript N(findPlaceForSummon) = { +EvtScript N(EVS_FindValidSummonPosition) = { EVT_SET(LVarE, -1) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) EVT_RETURN EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVar0) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0) EVT_IF_NE(LVar0, 0) EVT_RETURN EVT_END_IF + // check if each column is occupied EVT_SET(LFlag1, FALSE) EVT_SET(LFlag2, FALSE) EVT_SET(LFlag3, FALSE) @@ -845,109 +869,115 @@ EvtScript N(findPlaceForSummon) = { EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) EVT_CALL(InitTargetIterator) EVT_LABEL(0) - EVT_CALL(GetOwnerTarget, LVar0, LVar5) - EVT_CALL(GetIndexFromHome, LVar0, LVar5) - EVT_MOD(LVar5, 4) - EVT_SWITCH(LVar5) - EVT_CASE_EQ(0) - EVT_SET(LFlag1, TRUE) - EVT_CASE_EQ(1) - EVT_SET(LFlag2, TRUE) - EVT_CASE_EQ(2) - EVT_SET(LFlag3, TRUE) - EVT_CASE_EQ(3) - EVT_SET(LFlag4, TRUE) - EVT_END_SWITCH - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_NE(LVar0, -1) - EVT_GOTO(0) - EVT_END_IF + EVT_CALL(GetOwnerTarget, LVar0, LVar5) + EVT_CALL(GetIndexFromHome, LVar0, LVar5) + EVT_MOD(LVar5, 4) + EVT_SWITCH(LVar5) + EVT_CASE_EQ(0) + EVT_SET(LFlag1, TRUE) + EVT_CASE_EQ(1) + EVT_SET(LFlag2, TRUE) + EVT_CASE_EQ(2) + EVT_SET(LFlag3, TRUE) + EVT_CASE_EQ(3) + EVT_SET(LFlag4, TRUE) + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + // only summon if space in front of the Pokey is available, and never if Pokey is in front position EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVar1) EVT_SWITCH(LVar1) - EVT_CASE_EQ(0) - EVT_RETURN - EVT_CASE_EQ(1) + EVT_CASE_EQ(BTL_POS_GROUND_A) + EVT_RETURN // can't summon if Pokey is in front + EVT_CASE_EQ(BTL_POS_GROUND_B) EVT_IF_EQ(LFlag1, FALSE) - EVT_SET(LVarE, 0) + EVT_SET(LVarE, BTL_POS_GROUND_A) EVT_END_IF - EVT_CASE_EQ(2) + EVT_CASE_EQ(BTL_POS_GROUND_C) EVT_IF_EQ(LFlag2, FALSE) - EVT_SET(LVarE, 1) + EVT_SET(LVarE, BTL_POS_GROUND_B) EVT_END_IF - EVT_CASE_EQ(3) + EVT_CASE_EQ(BTL_POS_GROUND_D) EVT_IF_EQ(LFlag3, FALSE) - EVT_SET(LVarE, 2) + EVT_SET(LVarE, BTL_POS_GROUND_C) EVT_END_IF EVT_END_SWITCH EVT_RETURN EVT_END }; -Vec3i N(summon_pos) = { 400, -100, 0 }; +Vec3i N(SummonPos) = { 400, -100, 0 }; -Formation N(summon_formation) = { - ACTOR_BY_POS(NAMESPACE, N(summon_pos), 100), +Formation N(SummonFormation) = { + ACTOR_BY_POS(NAMESPACE, N(SummonPos), 100), }; -EvtScript N(unearthFriend) = { +EvtScript N(EVS_SummonBackup) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) EVT_CALL(BattleCamTargetActor, ACTOR_SELF) EVT_CALL(MoveBattleCamOver, 30) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim04) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4) + // lean back slightly EVT_CALL(MakeLerp, 0, -20, 20, EASING_COS_IN_OUT) EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF EVT_CHILD_THREAD EVT_WAIT(8) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_344) EVT_END_CHILD_THREAD + // lean forward EVT_CALL(MakeLerp, -20, 30, 20, EASING_COS_IN_OUT) EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF EVT_CHILD_THREAD EVT_WAIT(6) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_345) EVT_END_CHILD_THREAD + // lean back EVT_CALL(MakeLerp, 30, -40, 20, EASING_COS_IN_OUT) EVT_LABEL(2) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(2) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(2) + EVT_END_IF EVT_CHILD_THREAD EVT_WAIT(4) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EE) EVT_END_CHILD_THREAD + // smash into ground EVT_CALL(MakeLerp, -40, 90, 10, EASING_COS_IN_OUT) EVT_LABEL(3) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(3) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(3) + EVT_END_IF EVT_WAIT(20) + // create new Pokey actor EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_346) EVT_CALL(StartRumble, 9) EVT_THREAD EVT_CALL(ShakeCam, CAM_BATTLE, 0, 10, EVT_FLOAT(1.0)) EVT_END_THREAD - EVT_CALL(SummonEnemy, EVT_PTR(N(summon_formation)), 0) + EVT_CALL(SummonEnemy, EVT_PTR(N(SummonFormation)), FALSE) EVT_SET(LVarB, LVar0) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_SUB(LVar0, 40) @@ -956,54 +986,57 @@ EvtScript N(unearthFriend) = { EVT_CHILD_THREAD EVT_PLAY_EFFECT(EFFECT_SHOCKWAVE, 2, LVar0, 0, LVar2, 0) EVT_CALL(UseIdleAnimation, LVarB, FALSE) - EVT_CALL(SetAnimation, LVarB, 1, ANIM_Pokey_Anim0C) + EVT_CALL(SetAnimation, LVarB, 1, ANIM_Pokey_Hurt4) EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) EVT_CALL(SetActorJumpGravity, LVarB, EVT_FLOAT(1.2)) EVT_CALL(SetGoalPos, LVarB, LVar0, 0, LVar2) EVT_CALL(JumpToGoal, LVarB, 20, FALSE, TRUE, FALSE) EVT_WAIT(20) EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) - EVT_CALL(SetAnimation, LVarB, 1, ANIM_Pokey_Anim04) + EVT_CALL(SetAnimation, LVarB, 1, ANIM_Pokey_Idle4) EVT_CALL(SetHomePos, LVarB, LVar0, LVar1, LVar2) EVT_CALL(HPBarToHome, LVarB) EVT_CALL(UseIdleAnimation, LVarB, TRUE) EVT_END_CHILD_THREAD - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_SUMMON_COUNT), LVar1) + // set generation of child to parent generation + 1 + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar1) EVT_SWITCH(LVar1) - EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, LVarB, N(VAR_SUMMON_COUNT), 1) - EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, LVarB, N(VAR_SUMMON_COUNT), 2) + EVT_CASE_EQ(AVAL_Generation_First) + EVT_CALL(SetActorVar, LVarB, AVAR_Generation, AVAL_Generation_Second) + EVT_CASE_EQ(AVAL_Generation_Second) + EVT_CALL(SetActorVar, LVarB, AVAR_Generation, AVAL_Generation_Last) EVT_END_SWITCH EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(MoveBattleCamOver, 20) EVT_SET(LVarA, LVar0) + // pull back and overshoot EVT_CALL(MakeLerp, 90, -30, 7, EASING_QUADRATIC_OUT) EVT_LABEL(4) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(4) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(4) + EVT_END_IF EVT_WAIT(20) + // correct overshoot EVT_CALL(MakeLerp, -30, 0, 10, EASING_COS_IN_OUT) EVT_LABEL(5) - EVT_CALL(UpdateLerp) - EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(5) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(5) + EVT_END_IF EVT_WAIT(20) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim04) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4) EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_RETURN EVT_END }; -EvtScript N(attackHeadDive) = { +EvtScript N(EVS_Attack_SinglePartLeap) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_2EC, SOUND_2EC) @@ -1017,19 +1050,19 @@ EvtScript N(attackHeadDive) = { EVT_ADD(LVar0, 50) EVT_SET(LVar1, 0) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim0B) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run1) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim07) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1) EVT_WAIT(4) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) EVT_WAIT(1) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) EVT_WAIT(4) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim0B) - EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 2, BS_FLAGS1_10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run1) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, DMG_LEAP, BS_FLAGS1_10) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_MISS) EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) @@ -1080,11 +1113,11 @@ EvtScript N(attackHeadDive) = { EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim0B) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run1) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) EVT_EXEC_WAIT(EVS_Enemy_HopToPos) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim07) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1) EVT_RETURN EVT_END_CASE_GROUP EVT_END_SWITCH @@ -1101,8 +1134,8 @@ EvtScript N(attackHeadDive) = { EVT_END_CHILD_THREAD EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) EVT_WAIT(2) - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 0), 2, BS_FLAGS1_SP_EVT_ACTIVE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim07) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 0), DMG_LEAP, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_HIT) EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) @@ -1123,14 +1156,14 @@ EvtScript N(attackHeadDive) = { EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) EVT_SUB(LVar0, 10) EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim07) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1) EVT_CALL(SetGoalToHome, ACTOR_SELF) EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim0B) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run1) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) EVT_EXEC_WAIT(EVS_Enemy_HopToPos) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Anim07) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1) EVT_END_SWITCH EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) @@ -1138,25 +1171,25 @@ EvtScript N(attackHeadDive) = { EVT_END }; -EvtScript N(onSpinSmash) = { +EvtScript N(EVS_Pokey_SpinSmashHit) = { EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_RETURN EVT_END_IF - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVarA) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA) EVT_SWITCH(LVarA) EVT_CASE_EQ(0) - EVT_EXEC_WAIT(N(doSpinSmashHit)) + EVT_EXEC_WAIT(N(EVS_KnockPartAway)) EVT_CASE_EQ(1) - EVT_EXEC_WAIT(N(doSpinSmashHit)) + EVT_EXEC_WAIT(N(EVS_KnockPartAway)) EVT_CASE_EQ(2) - EVT_EXEC_WAIT(N(doSpinSmashHit)) + EVT_EXEC_WAIT(N(EVS_KnockPartAway)) EVT_CASE_EQ(3) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_END_SWITCH EVT_RETURN @@ -1165,55 +1198,56 @@ EvtScript N(onSpinSmash) = { #include "common/battle/SetAbsoluteStatusOffsets.inc.c" -EvtScript N(afterPartThrown) = { - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVarA) +// set actor vars for new size one unit smaller than previous +EvtScript N(EVS_DecrementSize) = { + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA) EVT_SWITCH(LVarA) EVT_CASE_EQ(0) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_IMMUNE), ANIM_Pokey_Anim05) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_UNK), ANIM_Pokey_Anim09) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), ANIM_Pokey_Anim0D) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_THROW1), ANIM_Pokey_Anim12) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_THROW2), ANIM_Pokey_Anim13) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN), ANIM_Pokey_Anim1A) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN2), ANIM_Pokey_Anim1B) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_3bodyParts))) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_NO_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), 1) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Immune, ANIM_Pokey_Idle3) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Run, ANIM_Pokey_Run3) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Hit, ANIM_Pokey_Hurt3) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Windup, ANIM_Pokey_Windup2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Throw, ANIM_Pokey_Throw2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, ANIM_Pokey_BurnHurt3) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, ANIM_Pokey_BurnStill3) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(ThreePartAnims))) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY3, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY3, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY2, ACTOR_PART_FLAG_NO_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY2, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, 1) EVT_CALL(SetActorSize, ACTOR_SELF, 62, EVT_IGNORE_ARG) EVT_CALL(SetPartSize, ACTOR_SELF, PRT_MAIN, 62, EVT_IGNORE_ARG) EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 55, 10, 45) EVT_CASE_EQ(1) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_IMMUNE), ANIM_Pokey_Anim06) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_UNK), ANIM_Pokey_Anim0A) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), ANIM_Pokey_Anim0E) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_THROW1), ANIM_Pokey_Anim14) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_THROW2), ANIM_Pokey_Anim15) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN), ANIM_Pokey_Anim1C) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN2), ANIM_Pokey_Anim1D) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_2bodyParts))) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_NO_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), 2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Immune, ANIM_Pokey_Idle2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Run, ANIM_Pokey_Run2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Hit, ANIM_Pokey_Hurt2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Windup, ANIM_Pokey_Windup1) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Throw, ANIM_Pokey_Throw1) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, ANIM_Pokey_BurnHurt2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, ANIM_Pokey_BurnStill2) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(TwoPartAnims))) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY2, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY2, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY1, ACTOR_PART_FLAG_NO_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY1, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, 2) EVT_CALL(SetActorSize, ACTOR_SELF, 44, EVT_IGNORE_ARG) EVT_CALL(SetPartSize, ACTOR_SELF, PRT_MAIN, 44, EVT_IGNORE_ARG) EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 35, 10, 25) EVT_CASE_EQ(2) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_IMMUNE), ANIM_Pokey_Anim07) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_UNK), ANIM_Pokey_Anim0B) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), ANIM_Pokey_Anim0F) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN), ANIM_Pokey_Anim1E) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN2), ANIM_Pokey_Anim1F) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_1bodyPart))) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_NO_TARGET, FALSE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), 3) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Immune, ANIM_Pokey_Idle1) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Run, ANIM_Pokey_Run1) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_Hit, ANIM_Pokey_Hurt1) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, ANIM_Pokey_BurnHurt1) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, ANIM_Pokey_BurnStill1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(OnePartAnims))) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY1, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_BODY1, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_SINGLE, ACTOR_PART_FLAG_NO_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_SINGLE, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, 3) EVT_CALL(SetActorSize, ACTOR_SELF, 26, EVT_IGNORE_ARG) EVT_CALL(SetPartSize, ACTOR_SELF, PRT_MAIN, 26, EVT_IGNORE_ARG) EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 15, 10, 5) @@ -1222,7 +1256,7 @@ EvtScript N(afterPartThrown) = { EVT_END }; -EvtScript N(bounceOnHit) = { +EvtScript N(EVS_HitReactionBounce) = { EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_ADD(LVar1, 18) EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) @@ -1265,121 +1299,121 @@ EvtScript N(bounceOnHit) = { EVT_END }; -EvtScript N(doSpinSmashHit) = { +EvtScript N(EVS_KnockPartAway) = { EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, FALSE) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) EVT_ELSE - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) EVT_END_IF - EVT_EXEC_WAIT(N(afterPartThrown)) - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_EXEC_WAIT(N(EVS_DecrementSize)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) EVT_CHILD_THREAD EVT_WAIT(4) - EVT_EXEC_WAIT(N(bounceOnHit)) + EVT_EXEC_WAIT(N(EVS_HitReactionBounce)) EVT_END_CHILD_THREAD EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_4 | TARGET_FLAG_8000 | TARGET_FLAG_10000) EVT_CALL(InitTargetIterator) EVT_LABEL(0) - EVT_CALL(GetOwnerID, LVar1) - EVT_CALL(GetOwnerTarget, LVar0, LVar9) - EVT_IF_NE(LVar1, LVar0) - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_GOTO(0) - EVT_END_IF + EVT_CALL(GetOwnerID, LVar1) + EVT_CALL(GetOwnerTarget, LVar0, LVar9) + EVT_IF_NE(LVar1, LVar0) + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_GOTO(0) + EVT_END_IF EVT_LABEL(1) - EVT_ADD(LVarF, 1) - EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) - EVT_IF_EQ(LVar0, -1) - EVT_GOTO(10) - EVT_END_IF - EVT_CALL(GetOwnerTarget, LVar0, LVar9) - EVT_CALL(GetActorFlags, LVar0, LVar1) - EVT_IF_FLAG(LVar1, ACTOR_FLAG_TARGET_ONLY) + EVT_ADD(LVarF, 1) + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_EQ(LVar0, -1) + EVT_GOTO(10) + EVT_END_IF + EVT_CALL(GetOwnerTarget, LVar0, LVar9) + EVT_CALL(GetActorFlags, LVar0, LVar1) + EVT_IF_FLAG(LVar1, ACTOR_FLAG_TARGET_ONLY) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetOwnerID, LVar0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(0.1)) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(7.0)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, TRUE) + EVT_CHILD_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 2, EVT_FLOAT(1.0)) + EVT_END_CHILD_THREAD + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(DispatchDamageEvent, LVar0, 1, EVENT_SPIN_SMASH_LAUNCH_HIT) EVT_GOTO(1) - EVT_END_IF - EVT_CALL(GetOwnerID, LVar0) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SET(LVar1, 0) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(7.0)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) - EVT_CHILD_THREAD - EVT_CALL(ShakeCam, CAM_BATTLE, 0, 2, EVT_FLOAT(1.0)) - EVT_END_CHILD_THREAD - EVT_CALL(SetGoalToTarget, ACTOR_SELF) - EVT_CALL(GetOwnerTarget, LVar0, LVar1) - EVT_CALL(DispatchDamageEvent, LVar0, 1, EVENT_SPIN_SMASH_LAUNCH_HIT) - EVT_GOTO(1) EVT_LABEL(10) EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_03) - EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) - EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, 296, 0, 0, 0, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(0.1)) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(6.0)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, 296, 0, 0, 0, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_RETURN EVT_END }; -EvtScript N(onHit) = { +EvtScript N(EVS_Pokey_Hit) = { EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) EVT_ELSE - EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) EVT_END_IF - EVT_EXEC_WAIT(N(afterPartThrown)) - EVT_SET_CONST(LVar0, 1) + EVT_EXEC_WAIT(N(EVS_DecrementSize)) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_CALL(GetLastEvent, ACTOR_SELF, LVar1) EVT_SWITCH(LVar1) EVT_CASE_OR_EQ(EVENT_BURN_HIT) EVT_CASE_OR_EQ(EVENT_BURN_DEATH) - EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Anim20) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN), LVar1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_PROJECTILE, ANIM_Pokey_BurnedProjectile) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, LVar1) EVT_END_CASE_GROUP EVT_CASE_DEFAULT - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_END_SWITCH EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) EVT_CHILD_THREAD EVT_WAIT(4) - EVT_EXEC_WAIT(N(bounceOnHit)) + EVT_EXEC_WAIT(N(EVS_HitReactionBounce)) EVT_END_CHILD_THREAD - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVarA) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA) EVT_IF_NE(LVarA, 3) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) - EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, EVT_FLOAT(6.0)) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_ADD(LVar0, 30) EVT_SET(LVar1, 0) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 10, 18, EASING_LINEAR) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 10, 18, EASING_LINEAR) EVT_ADD(LVar0, 20) - EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 8, 10, EASING_LINEAR) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 8, 10, EASING_LINEAR) EVT_LOOP(20) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_WAIT(1) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, FALSE) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_NO_TARGET, TRUE) - EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE) EVT_ELSE EVT_WAIT(30) EVT_END_IF EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN2), LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) @@ -1389,7 +1423,7 @@ EvtScript N(onHit) = { EVT_DIVF(LVar3, EVT_FLOAT(10.0)) EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar0, LVar1, LVar2, LVar3, 10, 0) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_BURN2), LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar1) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) EVT_WAIT(10) EVT_CASE_DEFAULT @@ -1398,9 +1432,9 @@ EvtScript N(onHit) = { EVT_END }; -EvtScript N(flee) = { - EVT_SET_CONST(LVar0, 1) - EVT_CALL(GetActorVar, ACTOR_SELF, N(VAR_ANIM_HIT), LVar1) +EvtScript N(EVS_Pokey_ScareAway) = { + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_CALL(GetActorFlags, ACTOR_SELF, LVar9) EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.05)) @@ -1416,7 +1450,7 @@ EvtScript N(flee) = { EVT_WAIT(20) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_WAIT(5) - EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_PARTS_THROWN), LVar2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar2) EVT_SWITCH(LVar2) EVT_CASE_EQ(0) EVT_SET(LVar2, 96) diff --git a/src/battle/common/actor/pokey_mummy.inc.c b/src/battle/common/actor/pokey_mummy.inc.c new file mode 100644 index 0000000000..38db041665 --- /dev/null +++ b/src/battle/common/actor/pokey_mummy.inc.c @@ -0,0 +1,1014 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Pokey.h" + +#define NAMESPACE A(pokey_mummy) + +extern s32 N(IdleAnimations_80218DC8)[]; +extern s32 N(IdleAnimations_80218EB8)[]; +extern EvtScript N(EVS_Init); +extern EvtScript N(takeTurn_80219D88); +extern EvtScript N(idle_80219040); +extern EvtScript N(handleEvent_80219050); +extern EvtScript N(8021B998); +extern EvtScript N(8021A6C8); +extern EvtScript N(8021B088); +extern EvtScript N(8021B1B4); +extern EvtScript N(8021BDE4); +extern EvtScript N(8021C2BC); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, + PRT_4 = 4, + PRT_5 = 5, + PRT_6 = 6, +}; + +s32 N(DefenseTable_80218C10)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_80218C1C)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 80, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 100, + STATUS_KEY_SHRINK, 90, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 20 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80218DC8), + .defenseTable = N(DefenseTable_80218C10), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 72 }, + .opacity = 255, + .idleAnimations = NULL, + .defenseTable = N(DefenseTable_80218C10), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -8 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 54 }, + .opacity = 255, + .idleAnimations = NULL, + .defenseTable = N(DefenseTable_80218C10), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -8 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_4, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 36 }, + .opacity = 255, + .idleAnimations = NULL, + .defenseTable = N(DefenseTable_80218C10), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -8 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_5, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 16 }, + .opacity = 255, + .idleAnimations = NULL, + .defenseTable = N(DefenseTable_80218C10), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -8 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_6, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80218EB8), + .defenseTable = N(DefenseTable_80218C10), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP | ACTOR_EVENT_FLAG_200000, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_POKEY_MUMMY, + .level = 10, + .maxHP = 4, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable_80218C1C), + .escapeChance = 60, + .airLiftChance = 90, + .hurricaneChance = 85, + .spookChance = 60, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 95, + .coinReward = 1, + .size = { 24, 80 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -15, 75 }, + .statusTextOffset = { 10, 65 }, +}; + +s32 N(IdleAnimations_80218DC8)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Idle4, + STATUS_KEY_STONE, ANIM_Pokey_Mummy_Still4, + STATUS_KEY_SLEEP, ANIM_Pokey_Mummy_Sleep4, + STATUS_KEY_STOP, ANIM_Pokey_Mummy_Still4, + STATUS_KEY_PARALYZE, ANIM_Pokey_Mummy_Still4, + STATUS_KEY_DIZZY, ANIM_Pokey_Mummy_Dizzy4, + STATUS_KEY_FEAR, ANIM_Pokey_Mummy_Dizzy4, + STATUS_END, +}; + +s32 N(IdleAnimations_80218E04)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Idle3, + STATUS_KEY_STONE, ANIM_Pokey_Mummy_Still3, + STATUS_KEY_SLEEP, ANIM_Pokey_Mummy_Sleep3, + STATUS_KEY_STOP, ANIM_Pokey_Mummy_Still3, + STATUS_KEY_PARALYZE, ANIM_Pokey_Mummy_Still3, + STATUS_KEY_DIZZY, ANIM_Pokey_Mummy_Dizzy3, + STATUS_KEY_FEAR, ANIM_Pokey_Mummy_Dizzy3, + STATUS_END, +}; + +s32 N(IdleAnimations_80218E40)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Idle2, + STATUS_KEY_STONE, ANIM_Pokey_Mummy_Still2, + STATUS_KEY_SLEEP, ANIM_Pokey_Mummy_Sleep2, + STATUS_KEY_STOP, ANIM_Pokey_Mummy_Still2, + STATUS_KEY_PARALYZE, ANIM_Pokey_Mummy_Still2, + STATUS_KEY_DIZZY, ANIM_Pokey_Mummy_Dizzy2, + STATUS_KEY_FEAR, ANIM_Pokey_Mummy_Dizzy2, + STATUS_END, +}; + +s32 N(IdleAnimations_80218E7C)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Idle1, + STATUS_KEY_STONE, ANIM_Pokey_Mummy_Still1, + STATUS_KEY_SLEEP, ANIM_Pokey_Mummy_Sleep1, + STATUS_KEY_STOP, ANIM_Pokey_Mummy_Still1, + STATUS_KEY_PARALYZE, ANIM_Pokey_Mummy_Still1, + STATUS_KEY_DIZZY, ANIM_Pokey_Mummy_Dizzy1, + STATUS_KEY_FEAR, ANIM_Pokey_Mummy_Dizzy1, + STATUS_END, +}; + +s32 N(IdleAnimations_80218EB8)[] = { + STATUS_KEY_NORMAL, ANIM_Pokey_Mummy_Projectile, + STATUS_END, +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80219D88))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80219040))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80219050))) + EVT_CALL(SetActorVar, ACTOR_SELF, 10, 0) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, 9, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x00310104) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0x00310108) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0x0031010C) + EVT_CALL(SetActorVar, ACTOR_SELF, 4, 0x00310110) + EVT_CALL(SetActorVar, ACTOR_SELF, 5, 0x00310111) + EVT_CALL(SetActorVar, ACTOR_SELF, 6, 0x00310118) + EVT_CALL(SetActorVar, ACTOR_SELF, 7, 0x00310119) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_80219040) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80219050) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(EVENT_HIT_COMBO) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CASE_EQ(EVENT_HIT) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_ELSE + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_IF_EQ(LVarA, 3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_ELSE + EVT_CALL(GetDamageSource, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) + EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) + EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) + EVT_EXEC_WAIT(N(8021BDE4)) + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_SWITCH + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(EVENT_DEATH) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_ELSE + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_IF_EQ(LVarA, 3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_ELSE + EVT_CALL(GetDamageSource, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) + EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) + EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) + EVT_EXEC_WAIT(N(8021BDE4)) + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_END_SWITCH + EVT_END_IF + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_CALL(GetActorVar, ACTOR_SELF, 6, LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar2) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_ELSE + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_IF_EQ(LVarA, 3) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_ELSE + EVT_CALL(GetDamageSource, LVarA) + EVT_SWITCH(LVarA) + EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) + EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) + EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) + EVT_EXEC_WAIT(N(8021BDE4)) + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_END_SWITCH + EVT_END_IF + EVT_END_IF + EVT_CASE_OR_EQ(EVENT_BURN_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, 6, LVar1) + EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar2) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_ELSE + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_IF_EQ(LVarA, 3) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_ELSE + EVT_CALL(GetDamageSource, LVarA) + EVT_SWITCH(LVarA) + EVT_CASE_OR_EQ(DMG_SRC_SHELL_TOSS) + EVT_CASE_OR_EQ(DMG_SRC_POWER_SHELL) + EVT_CASE_OR_EQ(DMG_SRC_FIRE_SHELL) + EVT_EXEC_WAIT(N(8021BDE4)) + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_END_SWITCH + EVT_END_IF + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_EXEC_WAIT(N(8021B088)) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_EXEC_WAIT(N(8021B088)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_LAUNCH_HIT) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_ELSE + EVT_EXEC_WAIT(N(8021BDE4)) + EVT_END_IF + EVT_CASE_EQ(EVENT_SPIN_SMASH_LAUNCH_DEATH) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_ELSE + EVT_EXEC_WAIT(N(8021BDE4)) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, -1) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_SPIKE_TAUNT) + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) + EVT_CALL(AfflictActor, ACTOR_PLAYER, STATUS_KEY_POISON, 3) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 77) + EVT_SET_CONST(LVar2, ANIM_Pokey_Mummy_Dizzy4) + EVT_CASE_EQ(1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 59) + EVT_SET_CONST(LVar2, ANIM_Pokey_Mummy_Dizzy3) + EVT_CASE_EQ(2) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 41) + EVT_SET_CONST(LVar2, ANIM_Pokey_Mummy_Dizzy2) + EVT_CASE_EQ(3) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 23) + EVT_SET_CONST(LVar2, ANIM_Pokey_Mummy_Dizzy1) + EVT_END_SWITCH + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAG_SLEEP) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar2) + EVT_END_IF + EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar6) + EVT_IF_FLAG(LVar6, STATUS_FLAG_SHRINK) + EVT_MULF(LVar0, EVT_FLOAT(0.4)) + EVT_MULF(LVar1, EVT_FLOAT(0.4)) + EVT_END_IF + EVT_ADDF(LVar3, LVar0) + EVT_ADDF(LVar4, LVar1) + EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar3, LVar4, LVar5, 20, 0) + EVT_WAIT(30) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_EXEC_WAIT(N(8021C2BC)) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_80219D88) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_IF_EQ(LVarA, 3) + EVT_EXEC_WAIT(N(8021A6C8)) + EVT_RETURN + EVT_END_IF + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 1) + EVT_END_IF + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_6, ACTOR_SOUND_JUMP, 0, 0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_ELSE + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) + EVT_END_IF + EVT_CHILD_THREAD + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(2.2)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Mummy_Projectile) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar5) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_SWITCH(LVarA) + EVT_CASE_EQ(0) + EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) + EVT_ADD(LVar1, 38) + EVT_ELSE + EVT_ADD(LVar1, 15) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(1.2)) + EVT_END_IF + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 15, TRUE) + EVT_CASE_EQ(1) + EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) + EVT_ADD(LVar1, 20) + EVT_ELSE + EVT_ADD(LVar1, 8) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(1.2)) + EVT_END_IF + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 15, TRUE) + EVT_CASE_EQ(2) + EVT_IF_NOT_FLAG(LVar5, STATUS_FLAG_SHRINK) + EVT_ADD(LVar1, 8) + EVT_ELSE + EVT_ADD(LVar1, 3) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(1.2)) + EVT_END_IF + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 15, TRUE) + EVT_CASE_EQ(3) + EVT_END_SWITCH + EVT_END_CHILD_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_342) + EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) + EVT_WAIT(12) + EVT_CALL(GetActorVar, ACTOR_SELF, 5, LVar1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) + EVT_WAIT(1) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2CE) + EVT_WAIT(3) + EVT_EXEC_WAIT(N(8021B1B4)) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_IF_EQ(LVar0, HIT_RESULT_LUCKY) + EVT_CHILD_THREAD + EVT_WAIT(5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_CHILD_THREAD + EVT_END_IF + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 80) + EVT_SUB(LVar1, 5) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(20.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Mummy_Projectile) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(20.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_Mummy_Projectile) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 40), 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 55) + EVT_SET(LVar1, 0) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(4.0)) + EVT_SUB(LVar0, 24) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(3.0)) + EVT_SUB(LVar0, 20) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 20, EASING_LINEAR) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021A6C8) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_2EC, SOUND_2EC) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EC, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Run1) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Idle1) + EVT_WAIT(4) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(4) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Run1) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 2, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_SET(LVar1, 10) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) + EVT_CHILD_THREAD + EVT_WAIT(2) + EVT_SET(LVar0, 0) + EVT_LOOP(5) + EVT_ADD(LVar0, 30) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_CHILD_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 22, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0) + EVT_CHILD_THREAD + EVT_WAIT(2) + EVT_SET(LVar0, 180) + EVT_LOOP(6) + EVT_ADD(LVar0, 30) + EVT_IF_EQ(LVar0, 360) + EVT_SET(LVar0, 0) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_CHILD_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Run1) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Idle1) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.1)) + EVT_CHILD_THREAD + EVT_WAIT(2) + EVT_SET(LVar0, 0) + EVT_LOOP(5) + EVT_ADD(LVar0, 30) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_CHILD_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 100), 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Idle1) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 10) + EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Idle1) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Run1) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_EXEC_WAIT(EVS_Enemy_HopToPos) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Mummy_Idle1) + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021B088) = { + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_SWITCH(LVarA) + EVT_CASE_EQ(0) + EVT_EXEC_WAIT(N(8021B998)) + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(8021B998)) + EVT_CASE_EQ(2) + EVT_EXEC_WAIT(N(8021B998)) + EVT_CASE_EQ(3) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(8021B1B4) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_SWITCH(LVarA) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x00310105) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0x00310109) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0x0031010D) + EVT_CALL(SetActorVar, ACTOR_SELF, 4, 0x00310112) + EVT_CALL(SetActorVar, ACTOR_SELF, 5, 0x00310113) + EVT_CALL(SetActorVar, ACTOR_SELF, 6, 0x0031011A) + EVT_CALL(SetActorVar, ACTOR_SELF, 7, 0x0031011B) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218E04))) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_NO_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_CALL(SetActorSize, ACTOR_SELF, 62, EVT_IGNORE_ARG) + EVT_CALL(SetPartSize, ACTOR_SELF, PRT_MAIN, 62, EVT_IGNORE_ARG) + EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 55, 10, 45) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x00310106) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0x0031010A) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0x0031010E) + EVT_CALL(SetActorVar, ACTOR_SELF, 4, 0x00310114) + EVT_CALL(SetActorVar, ACTOR_SELF, 5, 0x00310115) + EVT_CALL(SetActorVar, ACTOR_SELF, 6, 0x0031011C) + EVT_CALL(SetActorVar, ACTOR_SELF, 7, 0x0031011D) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218E40))) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_NO_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 2) + EVT_CALL(SetActorSize, ACTOR_SELF, 44, EVT_IGNORE_ARG) + EVT_CALL(SetPartSize, ACTOR_SELF, PRT_MAIN, 44, EVT_IGNORE_ARG) + EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 35, 10, 25) + EVT_CASE_EQ(2) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0x00310107) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0x0031010B) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0x0031010F) + EVT_CALL(SetActorVar, ACTOR_SELF, 6, 0x0031011E) + EVT_CALL(SetActorVar, ACTOR_SELF, 7, 0x0031011F) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80218E7C))) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_MULTI_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_NO_TARGET, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_MULTI_TARGET, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 3) + EVT_CALL(SetActorSize, ACTOR_SELF, 26, EVT_IGNORE_ARG) + EVT_CALL(SetPartSize, ACTOR_SELF, PRT_MAIN, 26, EVT_IGNORE_ARG) + EVT_CALL(N(SetAbsoluteStatusOffsets), -15, 15, 10, 5) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(8021B6AC) = { + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 18) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar3, LVar1) + EVT_WAIT(2) + EVT_SUB(LVar3, 1) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(3) + EVT_SUB(LVar3, 2) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(2) + EVT_SUB(LVar3, 3) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(1) + EVT_SUB(LVar3, 5) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(1) + EVT_SUB(LVar3, 7) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(1) + EVT_ADD(LVar3, 2) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(1) + EVT_ADD(LVar3, 3) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(1) + EVT_ADD(LVar3, 3) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(1) + EVT_SUB(LVar3, 3) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(1) + EVT_SUB(LVar3, 3) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_WAIT(1) + EVT_SUB(LVar3, 2) + EVT_CALL(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021B998) = { + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_ELSE + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) + EVT_END_IF + EVT_EXEC_WAIT(N(8021B1B4)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) + EVT_CHILD_THREAD + EVT_WAIT(4) + EVT_EXEC_WAIT(N(8021B6AC)) + EVT_END_CHILD_THREAD + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_4 | TARGET_FLAG_8000 | TARGET_FLAG_10000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerID, LVar1) + EVT_CALL(GetOwnerTarget, LVar0, LVar9) + EVT_IF_NE(LVar1, LVar0) + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_GOTO(0) + EVT_END_IF + EVT_LABEL(1) + EVT_ADD(LVarF, 1) + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_EQ(LVar0, -1) + EVT_GOTO(10) + EVT_END_IF + EVT_CALL(GetOwnerTarget, LVar0, LVar9) + EVT_CALL(GetActorFlags, LVar0, LVar1) + EVT_IF_FLAG(LVar1, ACTOR_FLAG_TARGET_ONLY) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetOwnerID, LVar0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(7.0)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) + EVT_CHILD_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 2, EVT_FLOAT(1.0)) + EVT_END_CHILD_THREAD + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(DispatchDamageEvent, LVar0, 1, EVENT_SPIN_SMASH_LAUNCH_HIT) + EVT_GOTO(1) + EVT_LABEL(10) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_03) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, 296, 0, 0, 0, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021BDE4) = { + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_ELSE + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_6, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(1.0)) + EVT_END_IF + EVT_EXEC_WAIT(N(8021B1B4)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar1) + EVT_SWITCH(LVar1) + EVT_CASE_OR_EQ(EVENT_BURN_HIT) + EVT_CASE_OR_EQ(EVENT_BURN_DEATH) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_Pokey_BurnedProjectile) + EVT_CALL(GetActorVar, ACTOR_SELF, 6, LVar1) + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) + EVT_CHILD_THREAD + EVT_WAIT(4) + EVT_EXEC_WAIT(N(8021B6AC)) + EVT_END_CHILD_THREAD + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_IF_NE(LVarA, 3) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 10, 18, EASING_LINEAR) + EVT_ADD(LVar0, 20) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 8, 10, EASING_LINEAR) + EVT_LOOP(20) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_WAIT(1) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_ELSE + EVT_WAIT(30) + EVT_END_IF + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) + EVT_DIV(LVar3, 2) + EVT_ADD(LVar1, LVar3) + EVT_ADD(LVar2, 5) + EVT_DIVF(LVar3, EVT_FLOAT(10.0)) + EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar0, LVar1, LVar2, LVar3, 10, 0) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, 7, LVar1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1) + EVT_WAIT(10) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(8021C2BC) = { + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar1) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetActorFlags, ACTOR_SELF, LVar9) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.05)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVarA, LVarB, LVarC) + EVT_SET(LVarD, LVarB) + EVT_ADD(LVarD, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVarA, LVarD, LVarC) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) + EVT_WAIT(20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVarA, LVarB, LVarC) + EVT_CALL(FallToGoal, ACTOR_SELF, 10) + EVT_WAIT(20) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_WAIT(5) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, 200, 0, 0) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_WAIT(8) + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(RemoveActor, ACTOR_SELF) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/putrid_piranha.inc.c b/src/battle/common/actor/putrid_piranha.inc.c index a65bf15b12..39a0e391c9 100644 --- a/src/battle/common/actor/putrid_piranha.inc.c +++ b/src/battle/common/actor/putrid_piranha.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/LargePiranha.h" +#define NAMESPACE A(putrid_piranha) + extern EvtScript N(init_8021B1F8); extern EvtScript N(takeTurn_8021B8A8); extern EvtScript N(idle_8021B244); @@ -141,82 +142,82 @@ EvtScript N(handleEvent_8021B3D0) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim10) EVT_SET_CONST(LVar2, ANIM_LargePiranha_Putrid_Anim11) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim10) EVT_SET_CONST(LVar2, ANIM_LargePiranha_Putrid_Anim11) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim11) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_EXEC_WAIT(N(8021B354)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim03) EVT_SET_CONST(LVar2, ANIM_LargePiranha_Putrid_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim03) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_LargePiranha_Putrid_Anim03) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/pyro_guy.inc.c b/src/battle/common/actor/pyro_guy.inc.c new file mode 100644 index 0000000000..efa25eeef3 --- /dev/null +++ b/src/battle/common/actor/pyro_guy.inc.c @@ -0,0 +1,331 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/PyroGuy.h" + +#define NAMESPACE A(pyro_guy) + +extern EvtScript N(init_8022CC80); +extern EvtScript N(takeTurn_8022D344); +extern EvtScript N(idle_8022CCCC); +extern EvtScript N(handleEvent_8022CE60); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(IdleAnimations_8022CB00)[] = { + STATUS_KEY_NORMAL, ANIM_PyroGuy_Anim01, + STATUS_KEY_STONE, ANIM_PyroGuy_Anim00, + STATUS_KEY_SLEEP, ANIM_PyroGuy_Anim07, + STATUS_KEY_POISON, ANIM_PyroGuy_Anim01, + STATUS_KEY_STOP, ANIM_PyroGuy_Anim00, + STATUS_KEY_STATIC, ANIM_PyroGuy_Anim01, + STATUS_KEY_PARALYZE, ANIM_PyroGuy_Anim00, + STATUS_KEY_DIZZY, ANIM_PyroGuy_Anim08, + STATUS_KEY_FEAR, ANIM_PyroGuy_Anim08, + STATUS_END, +}; + +s32 N(DefenseTable_8022CB4C)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_WATER, -2, + ELEMENT_ICE, -2, + ELEMENT_FIRE, 99, + ELEMENT_SHOCK, 0, + ELEMENT_SMASH, 0, + ELEMENT_BLAST, -1, + ELEMENT_END, +}; + +s32 N(StatusTable_8022CB88)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 80, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts_8022CC34)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8022CB00), + .defenseTable = N(DefenseTable_8022CB4C), + .eventFlags = ACTOR_EVENT_FLAG_FIREY, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_PYRO_GUY, + .level = 15, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts_8022CC34)), + .partsData = N(ActorParts_8022CC34), + .initScript = &N(init_8022CC80), + .statusTable = N(StatusTable_8022CB88), + .escapeChance = 60, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 60, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 85, + .coinReward = 1, + .size = { 28, 36 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(init_8022CC80) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8022D344))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8022CCCC))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8022CE60))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_8022CCCC) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(8022CDDC) = { + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim04) + EVT_SET_CONST(LVar2, ANIM_PyroGuy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8022CE60) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8022CDDC)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim03) + EVT_SET_CONST(LVar2, ANIM_PyroGuy_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_PyroGuy_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_UP_AND_AWAY) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8022D344) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 70) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim05) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8022CDDC)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim05) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE, 0, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_PyroGuy_Anim01) + EVT_WAIT(8) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(8022CDDC)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/red_magikoopa.inc.c b/src/battle/common/actor/red_magikoopa.inc.c index 9c7bdfa1c3..34ee30200a 100644 --- a/src/battle/common/actor/red_magikoopa.inc.c +++ b/src/battle/common/actor/red_magikoopa.inc.c @@ -1,10 +1,11 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" #include "sprite/npc/Magikoopa.h" #include "sprite/npc/FlyingMagikoopa.h" +#define NAMESPACE A(red_magikoopa) + extern EvtScript N(takeTurn); extern EvtScript N(init); extern EvtScript N(init_flying); @@ -230,54 +231,54 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Red_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Red_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -291,7 +292,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -303,7 +304,7 @@ EvtScript N(handleEvent) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_MAIN, -4, 5, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -422,13 +423,13 @@ EvtScript N(handleEvent_flying) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(EVENT_HIT) EVT_CASE_OR_EQ(EVENT_FALL_TRIGGER) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(knockOff)) @@ -436,46 +437,46 @@ EvtScript N(handleEvent_flying) = { EVT_CASE_OR_EQ(EVENT_BURN_HIT) EVT_CASE_OR_EQ(EVENT_15) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Red_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(knockOff)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Red_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -490,7 +491,7 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_FlyingMagikoopa_Red_Anim01) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -504,7 +505,7 @@ EvtScript N(handleEvent_flying) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -516,7 +517,7 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, -15, 0, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/red_shy_guy.inc.c b/src/battle/common/actor/red_shy_guy.inc.c index 28237ec982..c43dc13187 100644 --- a/src/battle/common/actor/red_shy_guy.inc.c +++ b/src/battle/common/actor/red_shy_guy.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/ShyGuy.h" +#define NAMESPACE A(red_shy_guy) + extern s32 N(IdleAnimations)[]; extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -125,7 +126,7 @@ EvtScript N(idle) = { EvtScript N(returnHome) = { EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) @@ -139,85 +140,85 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim14) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -275,7 +276,7 @@ EvtScript N(bumpAttack) = { EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) @@ -386,7 +387,7 @@ EvtScript N(acrobaticAttack) = { EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) @@ -471,7 +472,7 @@ EvtScript N(acrobaticAttack) = { EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_LABEL(2) EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetActorYaw, ACTOR_SELF, 0) diff --git a/src/battle/common/actor/ruff_puff.inc.c b/src/battle/common/actor/ruff_puff.inc.c new file mode 100644 index 0000000000..2deb8d5ed3 --- /dev/null +++ b/src/battle/common/actor/ruff_puff.inc.c @@ -0,0 +1,346 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/TuffPuff.h" + +#define NAMESPACE A(ruff_puff) + +extern EvtScript N(EVS_Init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_TuffPuff_Idle, + STATUS_KEY_STONE, ANIM_TuffPuff_Still, + STATUS_KEY_SLEEP, ANIM_TuffPuff_Sleep, + STATUS_KEY_POISON, ANIM_TuffPuff_Idle, + STATUS_KEY_STOP, ANIM_TuffPuff_Still, + STATUS_KEY_STATIC, ANIM_TuffPuff_Idle, + STATUS_KEY_PARALYZE, ANIM_TuffPuff_Still, + STATUS_KEY_DIZZY, ANIM_TuffPuff_Dizzy, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_MYSTERY, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 50, + STATUS_KEY_POISON, 90, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 100, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 70, + STATUS_KEY_PARALYZE, 40, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 80, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, -1, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -2, 26 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = 0, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -13 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_RUFF_PUFF, + .level = 19, + .maxHP = 10, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), + .escapeChance = 50, + .airLiftChance = 90, + .hurricaneChance = 90, + .spookChance = 40, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 80, + .coinReward = 2, + .size = { 32, 32 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_RETURN + EVT_END +}; + +#include "common/CosInterpMinMax.inc.c" + +EvtScript N(idle) = { + EVT_SET(LVarF, 0) + EVT_LOOP(0) + EVT_CALL(N(CosInterpMinMax), LVarF, LVar0, EVT_FLOAT(0.97), EVT_FLOAT(1.03), 15, 0, 0) + EVT_CALL(N(CosInterpMinMax), LVarF, LVar1, EVT_FLOAT(1.03), EVT_FLOAT(0.97), 15, 0, 0) + EVT_ADD(LVarF, 1) + EVT_CALL(SetActorScale, ACTOR_SELF, LVar1, LVar0, EVT_FLOAT(1.0)) + EVT_IF_GE(LVarF, 30) + EVT_SET(LVarF, 0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(returnHome) = { + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_TuffPuff_Run) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_SIN_OUT) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_TuffPuff_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_TuffPuff_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) + EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) + EVT_CALL(HPBarToCurrent, ACTOR_SELF) + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Run) + EVT_SET_CONST(LVar2, ANIM_TuffPuff_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_TuffPuff_Run) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_TuffPuff_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, EASING_SIN_OUT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_TuffPuff_Idle) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_TuffPuff_Grin) + EVT_WAIT(5) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, 0, LVar2) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SETF(LVar0, EVT_FLOAT(0.0)) + EVT_LOOP(15) + EVT_ADDF(LVar0, EVT_FLOAT(12.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(AddGoalPos, ACTOR_SELF, -10, 0, 0) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SETF(LVar0, EVT_FLOAT(180.0)) + EVT_LOOP(10) + EVT_ADDF(LVar0, EVT_FLOAT(18.0)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(AddGoalPos, ACTOR_SELF, -30, 0, 0) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(AddGoalPos, ACTOR_SELF, -20, 0, 0) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(AddGoalPos, ACTOR_SELF, -10, 0, 0) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_EXEC_WAIT(N(returnHome)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 13, 0) + EVT_SETF(LVar0, EVT_FLOAT(0.0)) + EVT_LOOP(8) + EVT_ADDF(LVar0, EVT_FLOAT(22.5)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, 4, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(2) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) + EVT_SETF(LVar0, EVT_FLOAT(180.0)) + EVT_LOOP(10) + EVT_SUBF(LVar0, EVT_FLOAT(22.5)) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(JumpWithBounce, ACTOR_SELF, 10, EVT_FLOAT(5.0)) + EVT_WAIT(10) + EVT_CALL(YieldTurn) + EVT_EXEC_WAIT(N(returnHome)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/sky_guy.inc.c b/src/battle/common/actor/sky_guy.inc.c new file mode 100644 index 0000000000..249ba73ed8 --- /dev/null +++ b/src/battle/common/actor/sky_guy.inc.c @@ -0,0 +1,1013 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/ShyGuy.h" +#include "sprite/npc/SkyGuy.h" + +#define NAMESPACE A(sky_guy) + +extern s32 N(IdleAnimations_8022B104)[]; +extern EvtScript N(init_8022987C); +extern EvtScript N(takeTurn_8022A9D0); +extern EvtScript N(takeTurn_8022CA9C); +extern EvtScript N(idle_80229A24); +extern EvtScript N(idle_8022B19C); +extern EvtScript N(handleEvent_8022A398); +extern EvtScript N(handleEvent_8022B310); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, + PRT_4 = 4, + PRT_5 = 5, + PRT_6 = 6, +}; + +s32 N(IdleAnimations_802294C0)[] = { + STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim01, + STATUS_KEY_STONE, ANIM_SkyGuy_Anim00, + STATUS_KEY_SLEEP, ANIM_SkyGuy_Anim04, + STATUS_KEY_POISON, ANIM_SkyGuy_Anim01, + STATUS_KEY_STOP, ANIM_SkyGuy_Anim00, + STATUS_KEY_STATIC, ANIM_SkyGuy_Anim01, + STATUS_KEY_PARALYZE, ANIM_SkyGuy_Anim00, + STATUS_KEY_DIZZY, ANIM_SkyGuy_Anim05, + STATUS_KEY_FEAR, ANIM_SkyGuy_Anim05, + STATUS_END, +}; + +s32 N(IdleAnimations_8022950C)[] = { + STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim10, + STATUS_KEY_STONE, ANIM_SkyGuy_Anim0D, + STATUS_KEY_SLEEP, ANIM_SkyGuy_Anim19, + STATUS_KEY_POISON, ANIM_SkyGuy_Anim10, + STATUS_KEY_STOP, ANIM_SkyGuy_Anim0D, + STATUS_KEY_STATIC, ANIM_SkyGuy_Anim10, + STATUS_KEY_PARALYZE, ANIM_SkyGuy_Anim0D, + STATUS_KEY_DIZZY, ANIM_SkyGuy_Anim10, + STATUS_KEY_FEAR, ANIM_SkyGuy_Anim10, + STATUS_END, +}; + +s32 N(IdleAnimations_80229558)[] = { + STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim0F, + STATUS_KEY_STONE, ANIM_SkyGuy_Anim0C, + STATUS_KEY_SLEEP, ANIM_SkyGuy_Anim18, + STATUS_KEY_POISON, ANIM_SkyGuy_Anim0F, + STATUS_KEY_STOP, ANIM_SkyGuy_Anim0C, + STATUS_KEY_STATIC, ANIM_SkyGuy_Anim0F, + STATUS_KEY_PARALYZE, ANIM_SkyGuy_Anim0C, + STATUS_KEY_DIZZY, ANIM_SkyGuy_Anim0F, + STATUS_KEY_FEAR, ANIM_SkyGuy_Anim0F, + STATUS_END, +}; + +s32 N(IdleAnimations_802295A4)[] = { + STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim11, + STATUS_KEY_STONE, ANIM_SkyGuy_Anim0E, + STATUS_KEY_SLEEP, ANIM_SkyGuy_Anim1A, + STATUS_KEY_POISON, ANIM_SkyGuy_Anim11, + STATUS_KEY_STOP, ANIM_SkyGuy_Anim0E, + STATUS_KEY_STATIC, ANIM_SkyGuy_Anim11, + STATUS_KEY_PARALYZE, ANIM_SkyGuy_Anim0E, + STATUS_KEY_DIZZY, ANIM_SkyGuy_Anim11, + STATUS_KEY_FEAR, ANIM_SkyGuy_Anim11, + STATUS_END, +}; + +s32 N(IdleAnimations_802295F0)[] = { + STATUS_KEY_NORMAL, ANIM_SkyGuy_Anim0B, + STATUS_END, +}; + +s32 N(DefenseTable_802295FC)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_SHOCK, 0, + ELEMENT_END, +}; + +s32 N(DefenseTable_80229610)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_SHOCK, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_80229624)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +s32 N(StatusTable_802296D0)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts_8022977C)[] = { + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 32 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8022B104), + .defenseTable = N(DefenseTable_80229610), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_802294C0), + .defenseTable = N(DefenseTable_802295FC), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 2, 50 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8022950C), + .defenseTable = N(DefenseTable_802295FC), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + .overrideNameMsg = MSG_EnemyName_Balloon, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_4, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80229558), + .defenseTable = N(DefenseTable_802295FC), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_5, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_802295A4), + .defenseTable = N(DefenseTable_802295FC), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_6, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_802295F0), + .defenseTable = N(DefenseTable_802295FC), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_SKY_GUY, + .level = 14, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts_8022977C)), + .partsData = N(ActorParts_8022977C), + .initScript = &N(init_8022987C), + .statusTable = N(StatusTable_80229624), + .escapeChance = 50, + .airLiftChance = 90, + .hurricaneChance = 90, + .spookChance = 80, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 90, + .coinReward = 1, + .size = { 28, 28 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(init_8022987C) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8022A9D0))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80229A24))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8022A398))) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_5, LVar0, LVar1, LVar2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar1, 5) + EVT_CALL(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CALL(SetPartTargetFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_TARGET_FLAG_4, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_80229A24) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(80229A34) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar2) + EVT_IF_NE(LVar2, 0) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 1) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar7, LVar8, LVar9) + EVT_ADD(LVar8, 20) + EVT_PLAY_EFFECT(EFFECT_BALLOON, 2, LVar7, LVar8, LVar9, EVT_FLOAT(1.0), 150, 0) + EVT_SUB(LVar7, 14) + EVT_SUB(LVar8, 4) + EVT_PLAY_EFFECT(EFFECT_BALLOON, 0, LVar7, LVar8, LVar9, EVT_FLOAT(1.0), 150, 0) + EVT_ADD(LVar7, 28) + EVT_PLAY_EFFECT(EFFECT_BALLOON, 1, LVar7, LVar8, LVar9, EVT_FLOAT(1.0), 150, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(80229C40) = { + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim02) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_3, ANIM_SkyGuy_Anim13) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_4, ANIM_SkyGuy_Anim12) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_5, ANIM_SkyGuy_Anim14) + EVT_RETURN + EVT_END +}; + +EvtScript N(80229CB0) = { + EVT_CALL(MakeLerp, 100, 80, 7, EASING_CUBIC_OUT) + EVT_LABEL(0) + EVT_CALL(UpdateLerp) + EVT_DIVF(LVar0, EVT_FLOAT(100.0)) + EVT_SETF(LVar2, EVT_FLOAT(2.0)) + EVT_SUBF(LVar2, LVar0) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, LVar2, LVar0, EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, LVar2, LVar0, EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_5, LVar2, LVar0, EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(MakeLerp, 80, 100, 7, EASING_COS_FAST_OVERSHOOT) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_DIVF(LVar0, EVT_FLOAT(100.0)) + EVT_SETF(LVar2, EVT_FLOAT(2.0)) + EVT_SUBF(LVar2, LVar0) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, LVar2, LVar0, EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, LVar2, LVar0, EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_5, LVar2, LVar0, EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_5, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_RETURN + EVT_END +}; + +#include "common/StartRumbleWithParams.inc.c" + +EvtScript N(80229F08) = { + EVT_CALL(GetLastElement, LVar0) + EVT_SET(LVar0, 65536) + EVT_IF_FLAG(LVar0, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_BLAST | DAMAGE_TYPE_4000 | DAMAGE_TYPE_SPINY_SURGE) + EVT_CALL(HideHealthBar, ACTOR_SELF) + EVT_THREAD + EVT_WAIT(20) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E1) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_3, ANIM_SkyGuy_Anim2E) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_4, ANIM_SkyGuy_Anim2D) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_5, ANIM_SkyGuy_Anim2F) + EVT_WAIT(30) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, 8, 2) + EVT_WAIT(15) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim00) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_263) + EVT_PLAY_EFFECT(EFFECT_EMOTE, 2, 0, LVar0, LVar1, LVar2, 24, 0, 25, 0, 0) + EVT_WAIT(25) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim06) + EVT_WAIT(30) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim06) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_301, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(N(StartRumbleWithParams), 120, 10) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 5, EVT_FLOAT(0.5)) + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) + EVT_CALL(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_NO_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim12) + EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 3, LVar0, LVar1, LVar2, 0, 0) + EVT_WAIT(40) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8022CA9C))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8022B19C))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8022B310))) + EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_SHY_GUY) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_ELSE + EVT_EXEC_WAIT(N(80229CB0)) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8022A398) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(EVENT_HIT_COMBO) + EVT_CALL(func_8026E914, LVar0, LVar1) + EVT_IF_GE(LVar1, 3) + EVT_EXEC_WAIT(N(80229CB0)) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_IF + EVT_CASE_EQ(EVENT_HIT) + EVT_CALL(func_8026E914, LVar0, LVar1) + EVT_IF_GE(LVar1, 3) + EVT_EXEC_WAIT(N(80229CB0)) + EVT_EXEC_WAIT(N(80229F08)) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_IF + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim09) + EVT_SET_CONST(LVar2, ANIM_SkyGuy_Anim0A) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim09) + EVT_SET_CONST(LVar2, ANIM_SkyGuy_Anim0A) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim0A) + EVT_EXEC_WAIT(N(80229A34)) + EVT_RETURN + EVT_CASE_EQ(EVENT_ZERO_DAMAGE) + EVT_CALL(func_8026E914, LVar0, LVar1) + EVT_IF_GE(LVar1, 3) + EVT_EXEC_WAIT(N(80229CB0)) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_IF + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_CALL(func_8026E914, LVar0, LVar1) + EVT_IF_GE(LVar1, 3) + EVT_EXEC_WAIT(N(80229CB0)) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_IF + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim06) + EVT_EXEC_WAIT(N(80229A34)) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_FIRST_STRIKE) + EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0) + EVT_CALL(HPBarToCurrent, ACTOR_SELF) + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim03) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, EASING_LINEAR) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim01) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_5, ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_3, ANIM_SkyGuy_Anim1F) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_4, ANIM_SkyGuy_Anim1E) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_5, ANIM_SkyGuy_Anim20) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim03) + EVT_SET_CONST(LVar2, ANIM_SkyGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SkyGuy_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_EXEC_WAIT(N(80229C40)) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8022A9D0) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 1) + EVT_END_IF + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E7) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim08) + EVT_WAIT(12) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 20) + EVT_ADD(LVar2, 2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_6, ANIM_SkyGuy_Anim0B) + EVT_WAIT(12) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E8) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_6, ACTOR_SOUND_JUMP, 0, 0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(HIT_RESULT_MISS) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 120) + EVT_SET(LVar1, 0) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(12.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_EXEC_WAIT(N(80229C40)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_CASE_EQ(HIT_RESULT_LUCKY) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 50) + EVT_SET(LVar1, -5) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(14.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 30, EASING_LINEAR) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SkyGuy_Anim07) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 65) + EVT_SET(LVar1, -5) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 15, EASING_LINEAR) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_EXEC_WAIT(N(80229C40)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_SWITCH + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(14.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 15, EASING_LINEAR) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVarF, DAMAGE_TYPE_NO_CONTACT, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVarF) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 55) + EVT_SET(LVar1, 0) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(6.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_6, EVT_FLOAT(0.1)) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_6, EVT_FLOAT(4.0)) + EVT_SUB(LVar0, 20) + EVT_CALL(FlyPartTo, ACTOR_SELF, PRT_6, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_6, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_EXEC_WAIT(N(80229C40)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +s32 N(IdleAnimations_8022B104)[] = { + STATUS_KEY_NORMAL, ANIM_ShyGuy_Red_Anim01, + STATUS_KEY_STONE, ANIM_ShyGuy_Red_Anim00, + STATUS_KEY_SLEEP, ANIM_ShyGuy_Red_Anim12, + STATUS_KEY_POISON, ANIM_ShyGuy_Red_Anim01, + STATUS_KEY_STOP, ANIM_ShyGuy_Red_Anim00, + STATUS_KEY_STATIC, ANIM_ShyGuy_Red_Anim01, + STATUS_KEY_PARALYZE, ANIM_ShyGuy_Red_Anim00, + STATUS_KEY_DIZZY, ANIM_ShyGuy_Red_Anim13, + STATUS_KEY_FEAR, ANIM_ShyGuy_Red_Anim13, + STATUS_END, +}; + +EvtScript N(8022B150) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8022CA9C))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8022B19C))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8022B310))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_8022B19C) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(8022B2AC) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8022B310) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8022B2AC)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim14) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8022B7EC) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_WAIT(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_END_THREAD + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_WAIT(8) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(8022B2AC)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8022BF14) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 80) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) + EVT_THREAD + EVT_WAIT(12) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) + EVT_THREAD + EVT_WAIT(9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) + EVT_SET(LVar3, 0) + EVT_LOOP(20) + EVT_SUB(LVar3, 30) + EVT_IF_LT(LVar3, 0) + EVT_ADD(LVar3, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim07) + EVT_WAIT(15) + EVT_GOTO(2) + EVT_LABEL(1) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim10) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 50) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim11) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim13) + EVT_END_IF + EVT_WAIT(25) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_LABEL(2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8022CA9C) = { + EVT_CALL(RandInt, 1, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_EXEC_WAIT(N(8022B7EC)) + EVT_ELSE + EVT_EXEC_WAIT(N(8022BF14)) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/slot_machine.inc.c b/src/battle/common/actor/slot_machine.inc.c index de2489d46f..906d802fb2 100644 --- a/src/battle/common/actor/slot_machine.inc.c +++ b/src/battle/common/actor/slot_machine.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" +// namespace not defined here; actor is associated with stages + extern EvtScript N(init); extern EvtScript N(takeTurn); extern EvtScript N(idle); diff --git a/src/battle/common/actor/spear_guy.inc.c b/src/battle/common/actor/spear_guy.inc.c new file mode 100644 index 0000000000..5e621b5ad5 --- /dev/null +++ b/src/battle/common/actor/spear_guy.inc.c @@ -0,0 +1,1509 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/ShyGuy.h" +#include "sprite/npc/SpearGuy.h" + +#define NAMESPACE A(spear_guy) + +extern s32 N(IdleAnimations_8021BF40)[]; +extern EvtScript N(init_80218980); +extern EvtScript N(takeTurn_8021BCB4); +extern EvtScript N(handleEvent_80218E3C); +extern EvtScript N(nextTurn_80218B24); +extern EvtScript N(idle_80218BE0); +extern EvtScript N(takeTurn_8021D8D8); +extern EvtScript N(idle_8021BFD8); +extern EvtScript N(handleEvent_8021C14C); +extern EvtScript N(8021BF8C); +extern Formation N(specialFormation_8021A8C0); +extern Formation N(specialFormation_8021A8DC); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, + PRT_3 = 3, + PRT_4 = 4, +}; + +s32 N(IdleAnimations_802185C0)[] = { + STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim04, + STATUS_KEY_STONE, ANIM_SpearGuy_Anim02, + STATUS_KEY_SLEEP, ANIM_SpearGuy_Anim0D, + STATUS_KEY_POISON, ANIM_SpearGuy_Anim0F, + STATUS_KEY_STOP, ANIM_SpearGuy_Anim02, + STATUS_KEY_STATIC, ANIM_SpearGuy_Anim04, + STATUS_KEY_PARALYZE, ANIM_SpearGuy_Anim02, + STATUS_KEY_DIZZY, ANIM_SpearGuy_Anim0F, + STATUS_KEY_FEAR, ANIM_SpearGuy_Anim0F, + STATUS_END, +}; + +s32 N(IdleAnimations_8021860C)[] = { + STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim03, + STATUS_KEY_STONE, ANIM_SpearGuy_Anim0D, + STATUS_KEY_SLEEP, ANIM_SpearGuy_Anim0D, + STATUS_KEY_POISON, ANIM_SpearGuy_Anim0F, + STATUS_KEY_STOP, ANIM_SpearGuy_Anim01, + STATUS_KEY_STATIC, ANIM_SpearGuy_Anim03, + STATUS_KEY_PARALYZE, ANIM_SpearGuy_Anim01, + STATUS_KEY_DIZZY, ANIM_SpearGuy_Anim0F, + STATUS_KEY_FEAR, ANIM_SpearGuy_Anim0F, + STATUS_END, +}; + +s32 N(IdleAnimations_80218658)[] = { + STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim14, + STATUS_END, +}; + +s32 N(IdleAnimations_80218664)[] = { + STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim19, + STATUS_END, +}; + +s32 N(DefenseTable_80218670)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_FIRE, 0, + ELEMENT_END, +}; + +s32 N(DefenseTable_80218684)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_SHOCK, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_80218698)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 80, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +s32 N(StatusTable_80218744)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 22 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_802185C0), + .defenseTable = N(DefenseTable_80218670), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_FRONT, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -3, -8 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021BF40), + .defenseTable = N(DefenseTable_80218684), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80218658), + .defenseTable = N(DefenseTable_80218684), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_4, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80218664), + .defenseTable = N(DefenseTable_80218684), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_SPEAR_GUY, + .level = 16, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_80218980), + .statusTable = N(StatusTable_80218698), + .escapeChance = 50, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 70, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 85, + .coinReward = 2, + .size = { 24, 24 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(setSpearStance) = { + EVT_SWITCH(LVar0) + EVT_CASE_EQ(2) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_802185C0))) + EVT_CALL(SetPartEventFlags, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021860C))) + EVT_CALL(SetPartEventFlags, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(init_80218980) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_EXEC_WAIT(N(setSpearStance)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim04) + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(setSpearStance)) + EVT_CALL(SetPartEventFlags, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim03) + EVT_END_SWITCH + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021BCB4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80218E3C))) + EVT_CALL(BindNextTurn, ACTOR_SELF, EVT_PTR(N(nextTurn_80218B24))) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) + EVT_CALL(GetEncounterTrigger, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(ENCOUNTER_TRIGGER_JUMP) + EVT_CASE_OR_EQ(ENCOUNTER_TRIGGER_HAMMER) + EVT_CASE_OR_EQ(ENCOUNTER_TRIGGER_PARTNER) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT, FALSE) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021860C))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim03) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(nextTurn_80218B24) = { + EVT_CALL(BindNextTurn, ACTOR_SELF, 0) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_80218BE0))) + EVT_RETURN + EVT_END +}; + +EvtScript N(80218B5C) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_IF_EQ(LVarA, 0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarB) + EVT_IF_FLAG(LVarB, STATUS_FLAG_SLEEP | STATUS_FLAG_FEAR | STATUS_FLAG_DIZZY) + EVT_ELSE + EVT_SET(LVar1, LVar2) + EVT_END_IF + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_80218BE0) = { + EVT_LABEL(0) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP | STATUS_FLAG_FEAR | STATUS_FLAG_DIZZY) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021860C))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT, FALSE) + EVT_ELSE + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_802185C0))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT, TRUE) + EVT_END_IF + EVT_CASE_EQ(1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_2, EVT_PTR(N(IdleAnimations_8021860C))) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) + EVT_CALL(SetPartEventBits, ACTOR_SELF, PRT_2, ACTOR_EVENT_FLAG_SPIKY_FRONT, FALSE) + EVT_END_SWITCH + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(80218D7C) = { + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim06) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim04) + EVT_CASE_EQ(1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim03) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80218E3C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) + EVT_EXEC_WAIT(N(80218B5C)) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarB) + EVT_IF_FLAG(LVarB, STATUS_FLAG_SLEEP | STATUS_FLAG_FEAR | STATUS_FLAG_DIZZY) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0A) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim0C) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0B) + EVT_SET_CONST(LVar2, -1) + EVT_END_IF + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0A) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim0C) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarB) + EVT_IF_FLAG(LVarB, STATUS_FLAG_SLEEP | STATUS_FLAG_FEAR | STATUS_FLAG_DIZZY) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0A) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0B) + EVT_SET_CONST(LVar2, -1) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_ELSE + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0A) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_END_IF + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) + EVT_EXEC_WAIT(N(80218B5C)) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) + EVT_EXEC_WAIT(N(80218B5C)) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim09) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) + EVT_EXEC_WAIT(N(80218B5C)) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) + EVT_EXEC_WAIT(N(80218B5C)) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) + EVT_EXEC_WAIT(N(80218B5C)) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_EXEC_WAIT(N(80218D7C)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim09) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim03) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim04) + EVT_EXEC_WAIT(N(80218B5C)) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim07) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) + EVT_EXEC_WAIT(N(80218B5C)) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim09) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim08) + EVT_EXEC_WAIT(N(80218B5C)) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(1) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_END_SWITCH + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim06) + EVT_SET_CONST(LVar2, ANIM_SpearGuy_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_2) + EVT_SET_CONST(LVar1, ANIM_SpearGuy_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIKE_TAUNT) + EVT_WAIT(10) + EVT_SET(LFlag0, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_SWITCH(LVarA) + EVT_CASE_EQ(0) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, -11) + EVT_ADD(LVar1, 3) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_IF_FLAG(LVar3, STATUS_FLAG_DIZZY) + EVT_ADD(LVar0, -4) + EVT_ADD(LVar1, 36) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_IF_FLAG(LVar3, STATUS_FLAG_SLEEP) + EVT_ADD(LVar0, -8) + EVT_ADD(LVar1, 36) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_IF_EQ(LFlag0, FALSE) + EVT_ADD(LVar0, -28) + EVT_ADD(LVar1, 8) + EVT_END_IF + EVT_CASE_EQ(1) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, -4) + EVT_ADD(LVar1, 15) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_IF_FLAG(LVar3, STATUS_FLAG_DIZZY) + EVT_ADD(LVar0, -4) + EVT_ADD(LVar1, 36) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_IF_FLAG(LVar3, STATUS_FLAG_SLEEP) + EVT_ADD(LVar0, -8) + EVT_ADD(LVar1, 36) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_IF_EQ(LFlag0, FALSE) + EVT_ADD(LVar0, -10) + EVT_ADD(LVar1, 38) + EVT_END_IF + EVT_END_SWITCH + EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) + EVT_WAIT(20) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(spearStab) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim06) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, 10) + EVT_ELSE + EVT_ADD(LVar0, 25) + EVT_END_IF + EVT_SET(LVar1, 0) + EVT_ADD(LVar2, 1) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim04) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim1A) + EVT_WAIT(15) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_309) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim1B) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_WAIT(20) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) + EVT_EXEC_WAIT(N(80218D7C)) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_309) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim1B) + EVT_WAIT(5) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_WAIT(20) + EVT_EXEC_WAIT(N(80218D7C)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(summonBackup) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_14) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 15) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_01) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_THREAD + EVT_WAIT(5) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FA) + EVT_WAIT(15) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FB) + EVT_END_THREAD + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim05) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim10) + EVT_WAIT(25) + EVT_THREAD + EVT_WAIT(5) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FA) + EVT_WAIT(15) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FB) + EVT_END_THREAD + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim05) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim10) + EVT_WAIT(30) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim05) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 15) + EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, LVar0, LVar1, LVar2, 30, 0) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim0E) + EVT_WAIT(20) + EVT_CALL(GetOriginalActorType, ACTOR_SELF, LVar0) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_4 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar1, LVar2) + EVT_CALL(GetOriginalActorType, LVar1, LVar2) + EVT_IF_EQ(LVar0, LVar2) + EVT_CALL(SetAnimation, LVar1, 2, ANIM_SpearGuy_Anim04) + EVT_CALL(GetIndexFromHome, LVar1, LVar3) + EVT_IF_LT(LVarA, LVar3) + EVT_CALL(GetActorVar, LVar1, 0, LVar4) + EVT_IF_EQ(LVar4, 0) + EVT_CALL(SetActorVar, LVar1, 0, 1) + EVT_CALL(SetIdleAnimations, LVar1, 2, EVT_PTR(N(IdleAnimations_8021860C))) + EVT_CALL(SetPartEventFlags, LVar1, 2, 16) + EVT_CALL(SetAnimation, LVar1, 2, ANIM_SpearGuy_Anim03) + EVT_END_IF + EVT_END_IF + EVT_END_IF + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar1) + EVT_IF_NE(LVar1, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_SET(LFlag0, FALSE) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_4 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(1) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetIndexFromHome, LVar0, LVar1) + EVT_IF_LT(LVar1, LVarA) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_EQ(LFlag0, FALSE) + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8021A8C0)), FALSE) + EVT_ELSE + EVT_CALL(SummonEnemy, EVT_PTR(N(specialFormation_8021A8DC)), FALSE) + EVT_END_IF + EVT_SET(LVarB, LVar0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetAnimation, LVarB, 2, ANIM_SpearGuy_Anim10) + EVT_CALL(SetGoalToIndex, LVarB, LVarA) + EVT_CALL(GetGoalPos, LVarB, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 220) + EVT_CALL(SetActorPos, LVarB, LVar0, 0, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_0, SOUND_0) + EVT_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FA) + EVT_WAIT(15) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FA) + EVT_WAIT(15) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FB) + EVT_WAIT(15) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2FB) + EVT_WAIT(15) + EVT_END_THREAD + EVT_CALL(SetActorSpeed, LVarB, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, LVarB, 0, FALSE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) + EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 15) + EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, LVar0, LVar1, LVar2, 30, 0) + EVT_CALL(SetAnimation, LVarB, 2, ANIM_SpearGuy_Anim0E) + EVT_WAIT(20) + EVT_IF_EQ(LFlag0, FALSE) + EVT_CALL(SetAnimation, LVarB, 2, ANIM_SpearGuy_Anim04) + EVT_ELSE + EVT_CALL(SetAnimation, LVarB, 2, ANIM_SpearGuy_Anim03) + EVT_END_IF + EVT_CALL(GetActorPos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(ForceHomePos, LVarB, LVar0, LVar1, LVar2) + EVT_CALL(HPBarToHome, LVarB) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, LVarB, 1, 1) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, LVarB, 1, 2) + EVT_END_SWITCH + EVT_CALL(SetActorVar, ACTOR_SELF, 1, 3) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +Vec3i N(vector3D_8021A8B4) = { NPC_DISPOSE_LOCATION }; + +Formation N(specialFormation_8021A8C0) = { + ACTOR_BY_POS(NAMESPACE, N(vector3D_8021A8B4), 100, 0), +}; + +Formation N(specialFormation_8021A8DC) = { + ACTOR_BY_POS(NAMESPACE, N(vector3D_8021A8B4), 100, 1), +}; + +EvtScript N(becomeShyGuy) = { + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 2) + EVT_WAIT(10) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim13) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim18) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_ADD(LVar1, 15) + EVT_SUB(LVar2, 1) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_4, EVT_FLOAT(0.5)) + EVT_ADD(LVar0, 50) + EVT_SUB(LVar2, 30) + EVT_THREAD + EVT_LOOP(15) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_4, 0, 0, 10) + EVT_WAIT(1) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_4, 0, 0, -10) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_206D) + EVT_THREAD + EVT_LOOP(10) + EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_4, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_SPARKLES, 3, LVar0, LVar1, LVar2, 5, 0) + EVT_WAIT(3) + EVT_END_LOOP + EVT_END_THREAD + EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_4, SOUND_2FC) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_4, ACTOR_SOUND_JUMP, 0, 0) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_4, LVar0, 0, LVar2, 30, TRUE) + EVT_WAIT(5) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_MULTI_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET) + EVT_CALL(SetPartFlags, ACTOR_SELF, PRT_4, ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_4 | ACTOR_PART_FLAG_2000 | ACTOR_PART_FLAG_NO_TARGET) + EVT_EXEC_WAIT(N(8021BF8C)) + EVT_CALL(SetActorType, ACTOR_SELF, ACTOR_TYPE_SHY_GUY) + EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE) + EVT_CALL(SetStatusTable, ACTOR_SELF, EVT_PTR(N(StatusTable_80218744))) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_RETURN + EVT_END +}; + +EvtScript N(spearThrow) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim06) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 200) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim15) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_SUB(LVar0, 100) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_SUB(LVar0, 70) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) + EVT_ELSE + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_3, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_4, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_END_IF + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim11) + EVT_WAIT(5) + EVT_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim17) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 10) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim12) + EVT_END_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, 20, LVar2) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, -30) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_THREAD + EVT_CALL(MakeLerp, -30, 45, 20, EASING_LINEAR) + EVT_LABEL(0) + EVT_CALL(UpdateLerp) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF + EVT_END_THREAD + EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_3, SOUND_30A) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_3, ACTOR_SOUND_JUMP, 0, 0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_SET(LVar1, 10) + EVT_ADD(LVar2, 2) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_3, EVT_FLOAT(0.7)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2, 20, TRUE) + EVT_WAIT(10) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_2, 0, ACTOR_DECORATION_SWEAT) + EVT_WAIT(30) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_2, 0) + EVT_WAIT(10) + EVT_EXEC_WAIT(N(becomeShyGuy)) + EVT_CALL(YieldTurn) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim11) + EVT_WAIT(5) + EVT_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim17) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 10) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_SpearGuy_Anim12) + EVT_END_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_3, LVar0, 20, LVar2) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, -30) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_THREAD + EVT_CALL(MakeLerp, -30, 45, 20, EASING_LINEAR) + EVT_LABEL(0) + EVT_CALL(UpdateLerp) + EVT_CALL(SetPartRotation, ACTOR_SELF, PRT_3, 0, 0, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF + EVT_END_THREAD + EVT_CALL(PlaySoundAtPart, ACTOR_SELF, PRT_3, SOUND_30A) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_3, ACTOR_SOUND_JUMP, 0, 0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar2, 2) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_3, EVT_FLOAT(0.7)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_3, LVar0, LVar1, LVar2, 20, TRUE) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_WAIT(3) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_WAIT(20) + EVT_EXEC_WAIT(N(becomeShyGuy)) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021B770) = { + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar5) + EVT_CALL(GetIndexFromHome, LVar0, LVar5) + EVT_MOD(LVar5, 4) + EVT_SWITCH(LVar5) + EVT_CASE_EQ(0) + EVT_SET(LFlag1, TRUE) + EVT_CASE_EQ(1) + EVT_SET(LFlag2, TRUE) + EVT_CASE_EQ(2) + EVT_SET(LFlag3, TRUE) + EVT_CASE_EQ(3) + EVT_SET(LFlag4, TRUE) + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_IF_EQ(LFlag1, FALSE) + EVT_SET(LVarA, 0) + EVT_RETURN + EVT_END_IF + EVT_IF_EQ(LFlag2, FALSE) + EVT_SET(LVarA, 1) + EVT_RETURN + EVT_END_IF + EVT_IF_EQ(LFlag3, FALSE) + EVT_SET(LVarA, 2) + EVT_RETURN + EVT_END_IF + EVT_IF_EQ(LFlag4, FALSE) + EVT_SET(LVarA, 3) + EVT_RETURN + EVT_END_IF + EVT_SET(LVarA, -1) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021B96C) = { + EVT_SET(LVar9, 0) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetOriginalActorType, LVar0, LVar2) + EVT_SWITCH(LVar2) + EVT_CASE_EQ(ACTOR_TYPE_JUNGLE_FUZZY) + EVT_CALL(GetStatusFlags, LVar0, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(GetActorVar, LVar0, 0, LVar3) + EVT_IF_NE(LVar3, 2) + EVT_ADD(LVar9, 1) + EVT_END_IF + EVT_END_IF + EVT_CASE_EQ(ACTOR_TYPE_SPEAR_GUY) + EVT_CALL(GetStatusFlags, LVar0, LVar3) + EVT_IF_NOT_FLAG(LVar3, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(GetActorVar, LVar0, 1, LVar3) + EVT_IF_LT(LVar3, 2) + EVT_ADD(LVar9, 1) + EVT_END_IF + EVT_END_IF + EVT_END_SWITCH + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(8021BB18) = { + EVT_CALL(GetIndexFromHome, ACTOR_SELF, LVarA) + EVT_SET(LFlag0, FALSE) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_4 | TARGET_FLAG_8000) + EVT_CALL(InitTargetIterator) + EVT_LABEL(0) + EVT_CALL(GetOwnerTarget, LVar0, LVar1) + EVT_CALL(GetIndexFromHome, LVar0, LVar1) + EVT_IF_LT(LVar1, LVarA) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_CALL(ChooseNextTarget, ITER_NEXT, LVar0) + EVT_IF_NE(LVar0, -1) + EVT_GOTO(0) + EVT_END_IF + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_SET(LVar0, 1) + EVT_EXEC_WAIT(N(setSpearStance)) + EVT_END_IF + EVT_ELSE + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_SET(LVar0, 0) + EVT_EXEC_WAIT(N(setSpearStance)) + EVT_END_IF + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021BCB4) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_EXEC_WAIT(N(spearStab)) + EVT_EXEC_WAIT(N(8021BB18)) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(0) + EVT_CASE_OR_EQ(1) + EVT_EXEC_WAIT(N(8021B770)) + EVT_IF_EQ(LVarA, -1) + EVT_EXEC_WAIT(N(spearStab)) + EVT_EXEC_WAIT(N(8021BB18)) + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(8021B96C)) + EVT_SWITCH(LVar9) + EVT_CASE_EQ(1) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 300) + EVT_EXEC_WAIT(N(summonBackup)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(2) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 150) + EVT_EXEC_WAIT(N(summonBackup)) + EVT_RETURN + EVT_END_IF + EVT_CASE_EQ(3) + EVT_CALL(RandInt, 1000, LVar0) + EVT_IF_LT(LVar0, 100) + EVT_EXEC_WAIT(N(summonBackup)) + EVT_RETURN + EVT_END_IF + EVT_END_SWITCH + EVT_EXEC_WAIT(N(spearStab)) + EVT_EXEC_WAIT(N(8021BB18)) + EVT_END_CASE_GROUP + EVT_CASE_EQ(2) + EVT_CALL(EnemyCreateTargetList, TARGET_FLAG_2 | TARGET_FLAG_8000) + EVT_CALL(GetTargetListLength, LVar0) + EVT_IF_EQ(LVar0, 1) + EVT_EXEC_WAIT(N(spearThrow)) + EVT_RETURN + EVT_END_IF + EVT_EXEC_WAIT(N(spearStab)) + EVT_EXEC_WAIT(N(8021BB18)) + EVT_CASE_EQ(3) + EVT_EXEC_WAIT(N(spearThrow)) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +s32 N(IdleAnimations_8021BF40)[] = { + STATUS_KEY_NORMAL, ANIM_ShyGuy_Red_Anim01, + STATUS_KEY_STONE, ANIM_ShyGuy_Red_Anim00, + STATUS_KEY_SLEEP, ANIM_ShyGuy_Red_Anim12, + STATUS_KEY_POISON, ANIM_ShyGuy_Red_Anim01, + STATUS_KEY_STOP, ANIM_ShyGuy_Red_Anim00, + STATUS_KEY_STATIC, ANIM_ShyGuy_Red_Anim01, + STATUS_KEY_PARALYZE, ANIM_ShyGuy_Red_Anim00, + STATUS_KEY_DIZZY, ANIM_ShyGuy_Red_Anim13, + STATUS_KEY_FEAR, ANIM_ShyGuy_Red_Anim13, + STATUS_END, +}; + +EvtScript N(8021BF8C) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021D8D8))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021BFD8))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021C14C))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_8021BFD8) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021C0E8) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021C14C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8021C0E8)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim03) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Red_Anim14) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021C628) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_WAIT(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_END_THREAD + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_WAIT(8) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(8021C0E8)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021CD50) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 80) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) + EVT_THREAD + EVT_WAIT(12) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) + EVT_THREAD + EVT_WAIT(9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) + EVT_SET(LVar3, 0) + EVT_LOOP(20) + EVT_SUB(LVar3, 30) + EVT_IF_LT(LVar3, 0) + EVT_ADD(LVar3, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim09) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim07) + EVT_WAIT(15) + EVT_GOTO(2) + EVT_LABEL(1) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim10) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 50) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim11) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim13) + EVT_END_IF + EVT_WAIT(25) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_LABEL(2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Red_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Red_Anim01) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021D8D8) = { + EVT_CALL(RandInt, 1, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_EXEC_WAIT(N(8021C628)) + EVT_ELSE + EVT_EXEC_WAIT(N(8021CD50)) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/spike_top.inc.c b/src/battle/common/actor/spike_top.inc.c index d3d6fb952e..16b5958b72 100644 --- a/src/battle/common/actor/spike_top.inc.c +++ b/src/battle/common/actor/spike_top.inc.c @@ -4,6 +4,8 @@ #include "script_api/battle.h" #include "sprite/npc/SpikeTop.h" +#define NAMESPACE A(spike_top) + extern s32 N(IdleAnimations)[]; extern EvtScript N(init); extern EvtScript N(idle); @@ -221,58 +223,58 @@ EvtScript N(spikeTop_HandleEvent_Ceiling) = { EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(spikeTop_FallDown)) EVT_CASE_EQ(EVENT_FLIP_TRIGGER) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(spikeTop_FallDown)) EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim19) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim1A) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(spikeTop_FallDown)) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim19) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim1A) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim1A) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim14) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim08) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim14) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim0D) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim0D) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_WAIT(2) @@ -281,18 +283,18 @@ EvtScript N(spikeTop_HandleEvent_Ceiling) = { EVT_EXEC_WAIT(N(spikeTop_FallDown)) EVT_END_IF EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim14) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, TRUE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim09) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim14) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) @@ -327,7 +329,7 @@ EvtScript N(spikeTop_HandleEvent_Floor) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim15) EVT_EXEC_WAIT(N(8021D57C)) @@ -336,12 +338,12 @@ EvtScript N(spikeTop_HandleEvent_Floor) = { EVT_CASE_EQ(EVENT_BURN_HIT) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_NE(LVar0, 2) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim16) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim17) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim18) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -349,25 +351,25 @@ EvtScript N(spikeTop_HandleEvent_Floor) = { EVT_CASE_EQ(EVENT_BURN_DEATH) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_NE(LVar0, 2) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim16) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim17) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim17) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim18) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim18) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_IF EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim15) EVT_EXEC_WAIT(N(8021D57C)) @@ -407,46 +409,46 @@ EvtScript N(spikeTop_HandleEvent_Floor) = { EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikeTop_Anim15) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim08) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_ZERO_DAMAGE) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikeTop_Anim0E) EVT_WAIT(8) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim05) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(EVENT_IMMUNE) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikeTop_Anim0C) EVT_WAIT(8) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim05) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF @@ -462,25 +464,25 @@ EvtScript N(spikeTop_HandleEvent_Floor) = { EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) EVT_WAIT(20) EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim15) EVT_EXEC_WAIT(N(8021D57C)) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim15) EVT_EXEC_WAIT(N(8021D57C)) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim15) EVT_EXEC_WAIT(N(8021D57C)) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim15) EVT_EXEC_WAIT(N(8021D57C)) @@ -489,30 +491,30 @@ EvtScript N(spikeTop_HandleEvent_Floor) = { EVT_CASE_EQ(EVENT_RECOVER_STATUS) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim03) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_END_IF EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim08) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim13) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim05) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim08) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim05) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_AirLift) @@ -520,10 +522,10 @@ EvtScript N(spikeTop_HandleEvent_Floor) = { EVT_CALL(SetActorDispOffset, ACTOR_SELF, 7, 0, 0) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim13) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim15) EVT_END_IF EVT_EXEC_WAIT(EVS_Enemy_BlowAway) @@ -531,13 +533,13 @@ EvtScript N(spikeTop_HandleEvent_Floor) = { EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) EVT_CALL(GetActorVar, ACTOR_SELF, 8, LVar0) EVT_IF_EQ(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim0B) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikeTop_Anim0C) EVT_WAIT(8) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim05) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_IF @@ -677,7 +679,7 @@ EvtScript N(spikeTop_TakeTurn_Ceiling) = { EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) EVT_WAIT(8) EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim08) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikeTop_Anim03) @@ -707,7 +709,7 @@ EvtScript N(spikeTop_TakeTurn_Floor) = { EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) EVT_WAIT(20) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim05) EVT_SET_CONST(LVar2, ANIM_SpikeTop_Anim03) EVT_EXEC_WAIT(EVS_Enemy_FlipBackUp) @@ -815,7 +817,7 @@ EvtScript N(spikeTop_TakeTurn_Floor) = { EVT_WAIT(8) EVT_CALL(YieldTurn) EVT_CALL(ResetAllActorSounds, ACTOR_SELF) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikeTop_Anim08) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikeTop_Anim03) diff --git a/src/battle/common/actor/spiked_gloomba.inc.c b/src/battle/common/actor/spiked_gloomba.inc.c new file mode 100644 index 0000000000..197e006c66 --- /dev/null +++ b/src/battle/common/actor/spiked_gloomba.inc.c @@ -0,0 +1,481 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/SpikedGoomba.h" +#include "effects.h" + +#define NAMESPACE A(spiked_gloomba) + +extern EvtScript N(init); +extern EvtScript N(takeTurn); +extern EvtScript N(idle); +extern EvtScript N(handleEvent); + +extern s32 N(IdleAnimations)[]; + +enum N(ActorPartIDs) { + PRT_MAIN = 1, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 80, + STATUS_KEY_FROZEN, 100, + STATUS_KEY_DIZZY, 80, + STATUS_KEY_FEAR, 80, + STATUS_KEY_STATIC, 80, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 80, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -12 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_SPIKED_GLOOMBA, + .level = 12, + .maxHP = 7, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init), + .statusTable = N(StatusTable), + .escapeChance = 65, + .airLiftChance = 90, + .hurricaneChance = 85, + .spookChance = 75, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 24, 28 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations)[] = { + STATUS_KEY_NORMAL, ANIM_SpikedGoomba_Dark_Idle, + STATUS_KEY_STONE, ANIM_SpikedGoomba_Dark_Still, + STATUS_KEY_SLEEP, ANIM_SpikedGoomba_Dark_Sleep, + STATUS_KEY_POISON, ANIM_SpikedGoomba_Dark_Idle, + STATUS_KEY_STOP, ANIM_SpikedGoomba_Dark_Still, + STATUS_KEY_STATIC, ANIM_SpikedGoomba_Dark_Idle, + STATUS_KEY_PARALYZE, ANIM_SpikedGoomba_Dark_Still, + STATUS_KEY_DIZZY, ANIM_SpikedGoomba_Dark_Dizzy, + STATUS_KEY_FEAR, ANIM_SpikedGoomba_Dark_Dizzy, + STATUS_END, +}; + +s32 N(IdleAnimations_step)[] = { + STATUS_KEY_NORMAL, ANIM_SpikedGoomba_Dark_Run, + STATUS_KEY_STONE, ANIM_SpikedGoomba_Dark_Still, + STATUS_KEY_SLEEP, ANIM_SpikedGoomba_Dark_Sleep, + STATUS_KEY_POISON, ANIM_SpikedGoomba_Dark_Idle, + STATUS_KEY_STOP, ANIM_SpikedGoomba_Dark_Still, + STATUS_KEY_STATIC, ANIM_SpikedGoomba_Dark_Run, + STATUS_KEY_PARALYZE, ANIM_SpikedGoomba_Dark_Still, + STATUS_KEY_DIZZY, ANIM_SpikedGoomba_Dark_Dizzy, + STATUS_KEY_FEAR, ANIM_SpikedGoomba_Dark_Dizzy, + STATUS_END, +}; + +EvtScript N(init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent))) + EVT_RETURN + EVT_END +}; + +EvtScript N(idle) = { + EVT_LABEL(10) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_step))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations))) + EVT_LOOP(80) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_GOTO(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_BurnEyesClosed) + EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_Dark_BurnEyesOpen) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_BurnEyesClosed) + EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_Dark_BurnEyesOpen) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_BurnEyesOpen) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Dizzy) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Electrocute) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_STAR_BEAM) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_HurtStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_END_FIRST_STRIKE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Run) + EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Run) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Dark_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIKE_TAUNT) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Laugh) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar3) + EVT_IF_FLAG(LVar3, STATUS_FLAG_SHRINK) + EVT_ADD(LVar1, 10) + EVT_ELSE + EVT_ADD(LVar1, 26) + EVT_END_IF + EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) + EVT_WAIT(20) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/CalculateArcsinDeg.inc.c" + +EvtScript N(takeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Run) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0) + EVT_WAIT(1) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 10) + EVT_ADD(LVar2, 3) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Sleep) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Hurt) + EVT_WAIT(5) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(5) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_THREAD + EVT_WAIT(4) + EVT_SET(LVar0, 180) + EVT_LOOP(4) + EVT_SUB(LVar0, 45) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Dizzy) + EVT_WAIT(5) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_CASE_DEFAULT + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2)) + EVT_THREAD + EVT_CALL(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0) + EVT_SET(LVar0, 0) + EVT_LOOP(16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6) + EVT_CALL(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar0) + EVT_SET(LVar1, LVar4) + EVT_SET(LVar2, LVar5) + EVT_SET(LVar3, LVar6) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(6) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) + EVT_END_THREAD + EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Midair) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_END_SWITCH + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1), EVT_FLOAT(0.8), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_WAIT(1) + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) + EVT_IF_GT(LVar0, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Laugh) + EVT_WAIT(15) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Idle) + EVT_WAIT(3) + EVT_END_IF + EVT_CALL(YieldTurn) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(2.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpikedGoomba_Dark_Run) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/spiked_goomba.inc.c b/src/battle/common/actor/spiked_goomba.inc.c index b095f29008..a0a3aa93f5 100644 --- a/src/battle/common/actor/spiked_goomba.inc.c +++ b/src/battle/common/actor/spiked_goomba.inc.c @@ -4,16 +4,28 @@ #include "script_api/battle.h" #include "sprite/npc/SpikedGoomba.h" +#define NAMESPACE A(spiked_goomba) + +extern s32 N(DefaultAnims)[]; +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); + enum N(ActorPartIDs) { PRT_MAIN = 1, }; -s32 N(DefenseTable_8021E3B0)[] = { +enum N(ActorParams) { + DMG_SPIKEBONK = 2, +}; + +s32 N(DefenseTable)[] = { ELEMENT_NORMAL, 0, ELEMENT_END, }; -s32 N(StatusTable_8021E3BC)[] = { +s32 N(StatusTable)[] = { STATUS_KEY_NORMAL, 0, STATUS_KEY_DEFAULT, 0, STATUS_KEY_SLEEP, 100, @@ -38,9 +50,6 @@ s32 N(StatusTable_8021E3BC)[] = { STATUS_END, }; -extern s32 N(IdleAnimations_8021E4B4)[]; -extern EvtScript N(init_8021E54C); - ActorPartBlueprint N(ActorParts)[] = { { .flags = ACTOR_PART_FLAG_MULTI_TARGET, @@ -48,8 +57,8 @@ ActorPartBlueprint N(ActorParts)[] = { .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 24 }, .opacity = 255, - .idleAnimations = N(IdleAnimations_8021E4B4), - .defenseTable = N(DefenseTable_8021E3B0), + .idleAnimations = N(DefaultAnims), + .defenseTable = N(DefenseTable), .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP, .elementImmunityFlags = 0, .projectileTargetOffset = { 0, -12 }, @@ -63,8 +72,8 @@ ActorBlueprint NAMESPACE = { .maxHP = 2, .partCount = ARRAY_COUNT( N(ActorParts)), .partsData = N(ActorParts), - .initScript = &N(init_8021E54C), - .statusTable = N(StatusTable_8021E3BC), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), .escapeChance = 90, .airLiftChance = 95, .hurricaneChance = 90, @@ -79,7 +88,7 @@ ActorBlueprint NAMESPACE = { .statusTextOffset = { 10, 20 }, }; -s32 N(IdleAnimations_8021E4B4)[] = { +s32 N(DefaultAnims)[] = { STATUS_KEY_NORMAL, ANIM_SpikedGoomba_Idle, STATUS_KEY_STONE, ANIM_SpikedGoomba_Still, STATUS_KEY_SLEEP, ANIM_SpikedGoomba_Sleep, @@ -92,7 +101,7 @@ s32 N(IdleAnimations_8021E4B4)[] = { STATUS_END, }; -s32 N(IdleAnimations_8021E500)[] = { +s32 N(ShuffleAnims)[] = { STATUS_KEY_NORMAL, ANIM_SpikedGoomba_Run, STATUS_KEY_STONE, ANIM_SpikedGoomba_Still, STATUS_KEY_SLEEP, ANIM_SpikedGoomba_Sleep, @@ -105,69 +114,65 @@ s32 N(IdleAnimations_8021E500)[] = { STATUS_END, }; -extern EvtScript N(takeTurn_8021F1BC); -extern EvtScript N(idle_8021E598); -extern EvtScript N(handleEvent_8021E874); - -EvtScript N(init_8021E54C) = { - EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021F1BC))) - EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021E598))) - EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021E874))) +EvtScript N(EVS_Init) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) EVT_RETURN EVT_END }; -EvtScript N(idle_8021E598) = { +EvtScript N(EVS_Idle) = { EVT_LABEL(10) - EVT_CALL(RandInt, 80, LVar0) - EVT_ADD(LVar0, 80) - EVT_LOOP(LVar0) - EVT_LABEL(0) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(RandInt, 80, LVar0) + EVT_ADD(LVar0, 80) + EVT_LOOP(LVar0) + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(0) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_ADD(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021E500))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021E4B4))) - EVT_LOOP(20) - EVT_LABEL(1) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(ShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) + EVT_LOOP(20) + EVT_LABEL(1) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(1) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_SUB(LVar0, 5) - EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021E500))) - EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) - EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) - EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8021E4B4))) - EVT_LOOP(80) - EVT_LABEL(2) - EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) - EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_END_LOOP + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 5) + EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(ShuffleAnims))) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleRunToGoal, ACTOR_SELF, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(DefaultAnims))) + EVT_LOOP(80) + EVT_LABEL(2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAGS_IMMOBILIZED) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF EVT_WAIT(1) - EVT_GOTO(2) - EVT_END_IF - EVT_WAIT(1) - EVT_END_LOOP - EVT_GOTO(10) + EVT_END_LOOP + EVT_GOTO(10) EVT_RETURN EVT_END }; -EvtScript N(handleEvent_8021E874) = { +EvtScript N(EVS_HandleEvent) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) @@ -175,41 +180,41 @@ EvtScript N(handleEvent_8021E874) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_BurnEyesClosed) EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_BurnEyesOpen) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_BurnEyesClosed) EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_BurnEyesOpen) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_BurnEyesOpen) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) @@ -224,10 +229,10 @@ EvtScript N(handleEvent_8021E874) = { EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Electrocute) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -235,16 +240,16 @@ EvtScript N(handleEvent_8021E874) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_HurtStill) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -257,21 +262,21 @@ EvtScript N(handleEvent_8021E874) = { EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Run) EVT_SET_CONST(LVar2, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Run) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_SpikedGoomba_Hurt) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -301,7 +306,7 @@ EvtScript N(handleEvent_8021E874) = { #include "common/CalculateArcsinDeg.inc.c" -EvtScript N(takeTurn_8021F1BC) = { +EvtScript N(EVS_TakeTurn) = { EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) @@ -432,7 +437,7 @@ EvtScript N(takeTurn_8021F1BC) = { EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.3), EVT_FLOAT(0.5), EVT_FLOAT(1.0)) EVT_WAIT(1) EVT_END_SWITCH - EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_SPIKEBONK, BS_FLAGS1_SP_EVT_ACTIVE) EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(HIT_RESULT_HIT) EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) diff --git a/src/battle/common/actor/spiny.inc.c b/src/battle/common/actor/spiny.inc.c index 394876a2b1..182533c045 100644 --- a/src/battle/common/actor/spiny.inc.c +++ b/src/battle/common/actor/spiny.inc.c @@ -1,9 +1,11 @@ #include "common.h" +#include "effects.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Spiny.h" #include "sprite/npc/Lakitu.h" -#include "effects.h" + +#define NAMESPACE A(spiny) extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -181,7 +183,7 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim09) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0A) EVT_EXEC_WAIT(N(getAnimation)) @@ -190,12 +192,12 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BURN_HIT) EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_IF_NE(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim0B) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim0D) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -203,36 +205,36 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BURN_DEATH) EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_IF_NE(LVar0, 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim0B) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim0D) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_IF EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim09) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0A) EVT_EXEC_WAIT(N(getAnimation)) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim09) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0A) EVT_EXEC_WAIT(N(getAnimation)) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim09) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0A) EVT_EXEC_WAIT(N(getAnimation)) @@ -264,13 +266,13 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim06) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Spiny_Anim07) EVT_WAIT(10) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_SWITCH @@ -295,13 +297,13 @@ EvtScript N(handleEvent) = { EVT_PLAY_EFFECT(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0) EVT_WAIT(20) EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim09) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0A) EVT_EXEC_WAIT(N(getAnimation)) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim09) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim0A) EVT_EXEC_WAIT(N(getAnimation)) @@ -311,11 +313,11 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_SWITCH @@ -323,13 +325,13 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim04) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim09) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_SWITCH @@ -337,10 +339,10 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim04) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim02) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_AirLift) @@ -348,10 +350,10 @@ EvtScript N(handleEvent) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim04) EVT_CASE_EQ(1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim02) EVT_END_SWITCH EVT_EXEC_WAIT(EVS_Enemy_BlowAway) @@ -382,7 +384,7 @@ EvtScript N(takeTurn) = { EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) EVT_WAIT(20) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Spiny_Anim02) EVT_SET_CONST(LVar2, ANIM_Spiny_Anim01) EVT_EXEC_WAIT(EVS_Enemy_FlipBackUp) diff --git a/src/battle/common/actor/spy_guy.inc.c b/src/battle/common/actor/spy_guy.inc.c new file mode 100644 index 0000000000..fddd296468 --- /dev/null +++ b/src/battle/common/actor/spy_guy.inc.c @@ -0,0 +1,623 @@ +#include "common.h" +#include "effects.h" +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/SpyGuy.h" + +#define NAMESPACE A(spy_guy) + +extern EvtScript N(init_802275D4); +extern EvtScript N(takeTurn_802293DC); +extern EvtScript N(idle_802276C4); +extern EvtScript N(handleEvent_80227ABC); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, +}; + +s32 N(IdleAnimations_80227400)[] = { + STATUS_KEY_NORMAL, ANIM_SpyGuy_Anim03, + STATUS_KEY_STONE, ANIM_SpyGuy_Anim01, + STATUS_KEY_SLEEP, ANIM_SpyGuy_Anim0F, + STATUS_KEY_POISON, ANIM_SpyGuy_Anim03, + STATUS_KEY_STOP, ANIM_SpyGuy_Anim01, + STATUS_KEY_STATIC, ANIM_SpyGuy_Anim03, + STATUS_KEY_PARALYZE, ANIM_SpyGuy_Anim01, + STATUS_KEY_DIZZY, ANIM_SpyGuy_Anim12, + STATUS_KEY_FEAR, ANIM_SpyGuy_Anim12, + STATUS_END, +}; + +s32 N(IdleAnimations_8022744C)[] = { + STATUS_KEY_NORMAL, ANIM_SpyGuy_Anim02, + STATUS_KEY_STONE, ANIM_SpyGuy_Anim00, + STATUS_KEY_SLEEP, ANIM_SpyGuy_Anim0F, + STATUS_KEY_POISON, ANIM_SpyGuy_Anim02, + STATUS_KEY_STOP, ANIM_SpyGuy_Anim00, + STATUS_KEY_STATIC, ANIM_SpyGuy_Anim02, + STATUS_KEY_PARALYZE, ANIM_SpyGuy_Anim00, + STATUS_KEY_DIZZY, ANIM_SpyGuy_Anim12, + STATUS_KEY_FEAR, ANIM_SpyGuy_Anim12, + STATUS_END, +}; + +s32 N(IdleAnimations_80227498)[] = { + STATUS_KEY_NORMAL, ANIM_SpyGuy_Anim10, + STATUS_END, +}; + +s32 N(DefenseTable_802274A4)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_SHOCK, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_802274B8)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 80, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts_80227564)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 30 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80227400), + .defenseTable = N(DefenseTable_802274A4), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -13 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_80227498), + .defenseTable = N(DefenseTable_802274A4), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_SPY_GUY, + .level = 15, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts_80227564)), + .partsData = N(ActorParts_80227564), + .initScript = &N(init_802275D4), + .statusTable = N(StatusTable_802274B8), + .escapeChance = 50, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 60, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 85, + .coinReward = 1, + .size = { 32, 32 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +EvtScript N(init_802275D4) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_802293DC))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_802276C4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80227ABC))) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0) + EVT_CALL(GetInstigatorValue, ACTOR_SELF, LVar0) + EVT_IF_NE(LVar0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8022744C))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim02) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(idle_802276C4) = { + EVT_RETURN + EVT_END +}; + +EvtScript N(802276D4) = { + EVT_CALL(GetActorVar, ACTOR_SELF, 3, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetLastDamage, ACTOR_SELF, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim02) + EVT_CASE_EQ(1) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) + EVT_END_SWITCH + EVT_LABEL(0) + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_FLAG(LVar0, BS_FLAGS1_100) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 1) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_80227400))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim17) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim19) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) + EVT_CASE_EQ(1) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8022744C))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim18) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim1A) + EVT_WAIT(5) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim02) + EVT_END_SWITCH + EVT_WAIT(10) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_80227ABC) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(EVENT_HIT_COMBO) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 1) + EVT_CASE_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 1) + EVT_EXEC_WAIT(N(802276D4)) + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0D) + EVT_SET_CONST(LVar2, ANIM_SpyGuy_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 1) + EVT_EXEC_WAIT(N(802276D4)) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0D) + EVT_SET_CONST(LVar2, ANIM_SpyGuy_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CALL(SetActorVar, ACTOR_SELF, 3, 1) + EVT_EXEC_WAIT(N(802276D4)) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_ZERO_DAMAGE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) + EVT_IF_EQ(LVar1, 0) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim02) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim03) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) + EVT_IF_EQ(LVar1, 0) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim02) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim03) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_EXEC_WAIT(N(802276D4)) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0B) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) + EVT_IF_EQ(LVar1, 0) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim02) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim03) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) + EVT_IF_EQ(LVar1, 0) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim06) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) + EVT_END_IF + EVT_SET_CONST(LVar2, ANIM_SpyGuy_Anim11) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) + EVT_IF_EQ(LVar1, 0) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim06) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar1) + EVT_IF_EQ(LVar1, 0) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim06) + EVT_ELSE + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) + EVT_END_IF + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(slingshotAttack) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 1) + EVT_END_IF + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E7) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim15) + EVT_WAIT(12) + EVT_WAIT(12) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim16) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_ADD(LVar1, 10) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_CALL(SetPartScale, ACTOR_SELF, PRT_2, EVT_FLOAT(0.4), EVT_FLOAT(0.4), EVT_FLOAT(0.4)) + EVT_END_IF + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2E8) + EVT_CALL(SetPartSounds, ACTOR_SELF, PRT_2, ACTOR_SOUND_JUMP, 0, 0) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_THREAD + EVT_LOOP(0) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_2, LVar3, LVar4, LVar5) + EVT_IF_GT(LVar0, LVar3) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_END_THREAD + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, -100, 0, 0) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_2, EVT_FLOAT(14.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(0.002)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, 0, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(YieldTurn) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_WAIT(15) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartMoveSpeed, ACTOR_SELF, PRT_2, EVT_FLOAT(14.0)) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(0.002)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2, 0, TRUE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(GetPartOffset, ACTOR_SELF, PRT_2, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 100) + EVT_CALL(SetPartJumpGravity, ACTOR_SELF, PRT_2, EVT_FLOAT(0.7)) + EVT_CALL(JumpPartTo, ACTOR_SELF, PRT_2, LVar0, 0, LVar2, 30, TRUE) + EVT_CALL(SetPartFlagBits, ACTOR_SELF, PRT_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EVT_CALL(YieldTurn) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +#include "common/ItemEntityJumpToPos.inc.c" + +#include "common/GetItemEntityPosition.inc.c" + +#include "common/DisableRandomAbility.inc.c" + +#include "common/SpyGuyActionFunc.inc.c" + +#include "common/StartRumbleWithParams.inc.c" + +EvtScript N(80228778) = { + EVT_LABEL(0) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVarA) + EVT_SWITCH(LVarA) + EVT_CASE_EQ(0) + EVT_CASE_EQ(1) + EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar1, LVar2, LVar3) + EVT_SET(LVar2, 0) + EVT_SUB(LVar3, 1) + EVT_CALL(N(DisableRandomAbility), LVar4, LVar5) + EVT_CALL(MakeItemEntity, LVar4, LVar1, LVar2, LVar3, ITEM_SPAWN_MODE_DECORATION, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 1, LVar0) + EVT_ADD(LVar1, 30) + EVT_CALL(N(ItemEntityJumpToPos), LVar0, LVar1, LVar2, LVar3, 20, EVT_FLOAT(1.0)) + EVT_ADD(LVar1, 20) + EVT_CALL(N(ItemEntityJumpToPos), LVar0, LVar1, LVar2, LVar3, 10, EVT_FLOAT(1.0)) + EVT_ADD(LVar1, 10) + EVT_CALL(N(ItemEntityJumpToPos), LVar0, LVar1, LVar2, LVar3, 5, EVT_FLOAT(1.0)) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CASE_EQ(2) + EVT_CALL(ShowMessageBox, LVar5, 60) + EVT_SUB(LVar1, 150) + EVT_CALL(N(ItemEntityJumpToPos), LVar0, LVar1, LVar2, LVar3, 30, EVT_FLOAT(1.0)) + EVT_CALL(RemoveItemEntity, LVar0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 3) + EVT_RETURN + EVT_END_SWITCH + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(hammerAttack) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(AddGoalPos, ACTOR_SELF, 70, 0, 0) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_NOT_FLAG(LVar1, STATUS_FLAG_SHRINK) + EVT_CALL(AddGoalPos, ACTOR_SELF, 20, 0, 0) + EVT_END_IF + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) + EVT_WAIT(10) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_THREAD + EVT_WAIT(4) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_327) + EVT_END_THREAD + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim0A) + EVT_WAIT(6) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim0A) + EVT_WAIT(5) + EVT_WAIT(2) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_SET(LFlag0, FALSE) + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) + EVT_CALL(N(SpyGuyActionFunc), LVar0) + EVT_IF_NE(LVar0, -1) + EVT_SET(LFlag0, TRUE) + EVT_END_IF + EVT_END_IF + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) + EVT_IF_LE(LVar0, 0) + EVT_WAIT(20) + EVT_GOTO(100) + EVT_END_IF + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAG_SHRINK) + EVT_WAIT(20) + EVT_GOTO(100) + EVT_END_IF + EVT_CALL(GetStatusFlags, ACTOR_PLAYER, LVar1) + EVT_IF_FLAG(LVar1, STATUS_FLAG_STONE | STATUS_FLAG_RIGHT_ON) + EVT_WAIT(20) + EVT_GOTO(100) + EVT_END_IF + EVT_IF_EQ(LFlag0, TRUE) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) + EVT_EXEC(N(80228778)) + EVT_WAIT(8) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 70) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) + EVT_LABEL(0) + EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) + EVT_IF_NE(LVar0, 0) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) + EVT_CALL(GetActorVar, ACTOR_SELF, 1, LVar0) + EVT_CALL(N(GetItemEntityPosition), LVar0, LVar1, LVar2, LVar3) + EVT_ADD(LVar1, 20) + EVT_SUB(LVar3, 2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_THREAD + EVT_WAIT(5) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20DC) + EVT_CALL(N(StartRumbleWithParams), 200, 10) + EVT_END_THREAD + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim09) + EVT_WAIT(5) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 2) + EVT_SUB(LVar1, 7) + EVT_PLAY_EFFECT(EFFECT_FIREWORK, 0, LVar1, LVar2, LVar3, EVT_FLOAT(1.0), 0, 0) + EVT_WAIT(40) + EVT_ELSE + EVT_WAIT(8) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim07) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 70) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim03) + EVT_WAIT(10) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar1, 10) + EVT_PLAY_EFFECT(EFFECT_EMOTE, 2, 0, LVar0, LVar1, LVar2, 25, -45, 20, 0, 0) + EVT_WAIT(20) + EVT_END_IF + EVT_LABEL(100) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_SpyGuy_Anim07) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_802293DC) = { + EVT_CALL(GetBattlePhase, LVar0) + EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) + EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(IdleAnimations_8022744C))) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_SpyGuy_Anim02) + EVT_END_IF + EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(0) + EVT_EXEC_WAIT(N(slingshotAttack)) + EVT_CASE_EQ(1) + EVT_EXEC_WAIT(N(hammerAttack)) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/stone_chomp.inc.c b/src/battle/common/actor/stone_chomp.inc.c new file mode 100644 index 0000000000..9335107cad --- /dev/null +++ b/src/battle/common/actor/stone_chomp.inc.c @@ -0,0 +1,769 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/StoneChomp.h" + +#define NAMESPACE A(stone_chomp) + +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_Chomp_HopToPos); +extern EvtScript N(EVS_UpdateChain); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_TARGET = 2, + PRT_CHAIN_1 = 3, + PRT_CHAIN_2 = 4, + PRT_CHAIN_3 = 5, + PRT_CHAIN_4 = 6, + PRT_CHAIN_5 = 7, + PRT_CHAIN_6 = 8, + PRT_CHAIN_7 = 9, + PRT_CHAIN_8 = 10, +}; + +enum N(ActorVars) { + AVAR_EnableChainSounds = 8, +}; + +enum N(ActorParams) { + DMG_CHOMP_BITE = 3, +}; + +s32 N(BasicAnims)[] = { + STATUS_KEY_NORMAL, ANIM_StoneChomp_Idle, + STATUS_KEY_STONE, ANIM_StoneChomp_Still, + STATUS_KEY_SLEEP, ANIM_StoneChomp_Sleep, + STATUS_KEY_POISON, ANIM_StoneChomp_Idle, + STATUS_KEY_STOP, ANIM_StoneChomp_Still, + STATUS_KEY_STATIC, ANIM_StoneChomp_Idle, + STATUS_KEY_DIZZY, ANIM_StoneChomp_Dizzy, + STATUS_END, +}; + +s32 N(QuickBiteAnims)[] = { + STATUS_KEY_NORMAL, ANIM_StoneChomp_QuickBite, + STATUS_KEY_POISON, ANIM_StoneChomp_QuickBite, + STATUS_KEY_STOP, ANIM_StoneChomp_Still, + STATUS_KEY_STONE, ANIM_StoneChomp_Still, + STATUS_KEY_SLEEP, ANIM_StoneChomp_Sleep, + STATUS_KEY_STATIC, ANIM_StoneChomp_QuickBite, + STATUS_KEY_DIZZY, ANIM_StoneChomp_Dizzy, + STATUS_END, +}; + +s32 N(BiteAnims)[] = { + STATUS_KEY_NORMAL, ANIM_StoneChomp_Bite, + STATUS_KEY_POISON, ANIM_StoneChomp_Bite, + STATUS_KEY_STOP, ANIM_StoneChomp_Still, + STATUS_KEY_STONE, ANIM_StoneChomp_Still, + STATUS_KEY_SLEEP, ANIM_StoneChomp_Sleep, + STATUS_KEY_STATIC, ANIM_StoneChomp_Bite, + STATUS_KEY_DIZZY, ANIM_StoneChomp_Dizzy, + STATUS_END, +}; + +s32 N(SlowBiteAnims)[] = { + STATUS_KEY_NORMAL, ANIM_StoneChomp_SlowBite, + STATUS_KEY_POISON, ANIM_StoneChomp_SlowBite, + STATUS_KEY_STOP, ANIM_StoneChomp_Still, + STATUS_KEY_STONE, ANIM_StoneChomp_Still, + STATUS_KEY_SLEEP, ANIM_StoneChomp_Sleep, + STATUS_KEY_STATIC, ANIM_StoneChomp_SlowBite, + STATUS_KEY_DIZZY, ANIM_StoneChomp_Dizzy, + STATUS_END, +}; + +s32 N(ChainAnims)[] = { + STATUS_KEY_NORMAL, ANIM_StoneChomp_Chain, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 1, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 0, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 75, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 50, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 75, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, -1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, -1, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(BasicAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION | ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_TARGET, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -13, 40 }, + .opacity = 255, + .idleAnimations = N(BasicAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -14 }, + }, + { + .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_CHAIN_1, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 12 }, + .opacity = 255, + .idleAnimations = N(ChainAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_CHAIN_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 12 }, + .opacity = 255, + .idleAnimations = N(ChainAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_CHAIN_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 12 }, + .opacity = 255, + .idleAnimations = N(ChainAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_CHAIN_4, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 12 }, + .opacity = 255, + .idleAnimations = N(ChainAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_CHAIN_5, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 12 }, + .opacity = 255, + .idleAnimations = N(ChainAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_CHAIN_6, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 12 }, + .opacity = 255, + .idleAnimations = N(ChainAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_CHAIN_7, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 12 }, + .opacity = 255, + .idleAnimations = N(ChainAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_2 | ACTOR_PART_FLAG_4000 | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_CHAIN_8, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 12 }, + .opacity = 255, + .idleAnimations = N(ChainAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_STONE_CHOMP, + .level = 14, + .maxHP = 4, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), + .escapeChance = 0, + .airLiftChance = 25, + .hurricaneChance = 25, + .spookChance = 0, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 85, + .coinReward = 5, + .size = { 56, 40 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +#define CHOMP_CHAIN_FIRST_PART_IDX PRT_CHAIN_1 +#define CHOMP_CHAIN_LAST_PART_IDX PRT_CHAIN_8 +#define CHOMP_CHAIN_AVAR_SOUNDS AVAR_EnableChainSounds +#include "common/battle/ChompChainSupport.inc.c" + +// Custom version of EVS_Enemy_HopHome +// (in) LVar0: part idx +// (in) LVar1: hopping animID +EvtScript N(EVS_Chomp_HopHome) = { + EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0)) + EVT_EXEC_WAIT(N(EVS_Chomp_HopToPos)) + EVT_RETURN + EVT_END +}; + +// Custom version of EVS_Enemy_HopToPos +// (in) LVar0: target posX +// (in) LVar1: target posY +// (in) LVar2: target posZ +EvtScript N(EVS_Chomp_HopToPos) = { + EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_LABEL(0) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5) + EVT_IF_EQ(LVar3, LVar0) + EVT_GOTO(10) + EVT_END_IF + EVT_IF_LT(LVar3, LVar0) + EVT_SET(LVar4, LVar0) + EVT_SUB(LVar4, LVar3) + EVT_IF_LT(LVar4, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_ELSE + EVT_SET(LVar4, LVar3) + EVT_ADD(LVar3, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar3, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_END_IF + EVT_ELSE + EVT_SET(LVar4, LVar3) + EVT_SUB(LVar4, LVar0) + EVT_IF_LT(LVar4, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_ELSE + EVT_SUB(LVar3, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar3, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_END_IF + EVT_END_IF + EVT_GOTO(0) + EVT_LABEL(10) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Init) = { + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(EVS_TakeTurn))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(EVS_Idle))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(EVS_HandleEvent))) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) + EVT_SET(LVar0, PRT_CHAIN_1) + EVT_LOOP(1 + (PRT_CHAIN_8 - PRT_CHAIN_1)) + EVT_CALL(SetPartSize, ACTOR_SELF, LVar0, 16, 16) + EVT_ADD(LVar0, 1) + EVT_END_LOOP + EVT_CALL(N(ChompChainInit)) + EVT_EXEC(N(EVS_UpdateChain)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_UpdateTargetPartPos) = { + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_TARGET, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_TARGET, 0, 0) + EVT_ELSE + EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) + EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_TARGET, -13, 40) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_TARGET, 0, -14) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Idle) = { + EVT_LABEL(0) + EVT_LOOP(0) + EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(SlowBiteAnims))) + EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) + EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 11, 1) + EVT_LOOP(0) + EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(1.0)) + EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) + EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 6, 1) + EVT_CALL(RandInt, 10, LVar0) + EVT_ADD(LVar0, 1) + EVT_WAIT(LVar0) + EVT_LOOP(0) + EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(BiteAnims))) + EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) + EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 15, 1) + EVT_LOOP(0) + EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(SlowBiteAnims))) + EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) + EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 12, 1) + EVT_LOOP(0) + EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) + EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 9, 1) + EVT_LOOP(0) + EVT_EXEC_WAIT(N(EVS_UpdateTargetPartPos)) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_BREAK_LOOP + EVT_END_IF + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, EVT_PTR(N(QuickBiteAnims))) + EVT_CALL(SetActorIdleJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetIdleGoalToHome, ACTOR_SELF) + EVT_CALL(GetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(IdleJumpToGoal, ACTOR_SELF, 6, 1) + EVT_CALL(RandInt, 10, LVar0) + EVT_ADD(LVar0, 10) + EVT_WAIT(LVar0) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_UpdateChain) = { + EVT_LABEL(0) + EVT_WAIT(1) + EVT_CALL(N(ChompChainUpdate)) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_HandleEvent) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_1, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_2, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_3, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_4, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_5, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_6, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_7, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_8, ANIM_StoneChomp_BurnChain) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_StoneChomp_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_1, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_2, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_3, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_4, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_5, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_6, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_7, ANIM_StoneChomp_BurnChain) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_CHAIN_8, ANIM_StoneChomp_BurnChain) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_BurnHurt) + EVT_SET_CONST(LVar2, ANIM_StoneChomp_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_BurnStill) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetAnimation, ACTOR_SELF, LVar0, LVar1) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.4)) + EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_CALL(AddGoalPos, ACTOR_SELF, 15, 0, 0) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_CALL(AddGoalPos, ACTOR_SELF, 5, 0, 0) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_SlowBite) + EVT_EXEC_WAIT(N(EVS_Chomp_HopHome)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6)) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_THREAD + EVT_CALL(ShakeCam, CAM_BATTLE, 0, 1, EVT_FLOAT(0.5)) + EVT_END_THREAD + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Idle) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Idle) + EVT_SET_CONST(LVar2, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_NOT_FLAG(LVar0, STATUS_FLAGS_IMMOBILIZED) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SHRINK) + EVT_SUB(LVar1, 10) + EVT_ADD(LVar2, 4) + EVT_ELSE + EVT_SUB(LVar1, 5) + EVT_ADD(LVar2, 11) + EVT_END_IF + EVT_CALL(SetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3) + EVT_END_IF + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Hurt) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_StoneChomp_Idle) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_CALL(SetAnimationRate, ACTOR_SELF, PRT_MAIN, EVT_FLOAT(1.0)) + EVT_CASE_EQ(EVENT_UP_AND_AWAY) + EVT_WAIT(1000) + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP | STATUS_FLAG_PARALYZE | STATUS_FLAG_DIZZY | STATUS_FLAG_STONE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_IF_NE(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, 0, LVar2) + EVT_CALL(FallToGoal, ACTOR_SELF, 11) + EVT_END_IF + EVT_END_IF + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_TakeTurn) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, TRUE) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SET(LVar1, 0) + EVT_ADD(LVar0, 45) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_SlowBite) + EVT_WAIT(15) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_10F) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 20) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 25) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_SUB(LVar0, 15) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Bite) + EVT_WAIT(20) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(YieldTurn) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Bite) + EVT_EXEC_WAIT(N(EVS_Chomp_HopToPos)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVarA) + EVT_IF_FLAG(LVarA, STATUS_FLAG_SHRINK) + EVT_ADD(LVar0, 4) + EVT_ELSE + EVT_ADD(LVar0, 10) + EVT_END_IF + EVT_SET(LVar1, 27) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.2)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_CHOMP_BITE, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Bite) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_ADD(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_ADD(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_SUB(LVar0, 10) + EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_3F9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) + EVT_WAIT(8) + EVT_CALL(YieldTurn) + EVT_CALL(SetGoalToHome, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Bite) + EVT_EXEC_WAIT(N(EVS_Chomp_HopToPos)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_StoneChomp_Idle) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetPartPos, ACTOR_SELF, PRT_TARGET, LVar0, LVar1, LVar2) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorVar, ACTOR_SELF, AVAR_EnableChainSounds, FALSE) + EVT_CALL(HPBarToHome, ACTOR_SELF) + EVT_CALL(EnableIdleScript, ACTOR_SELF, -1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/actor/swooper.inc.c b/src/battle/common/actor/swooper.inc.c index c6d649d75d..bceef1e67a 100644 --- a/src/battle/common/actor/swooper.inc.c +++ b/src/battle/common/actor/swooper.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Swooper.h" +#define NAMESPACE A(swooper) + extern s32 N(IdleAnimations)[]; extern EvtScript N(init); extern EvtScript N(takeTurn); @@ -156,77 +157,77 @@ EvtScript N(hadleEvent_flying) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim17) EVT_SET_CONST(LVar2, ANIM_Swooper_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim17) EVT_SET_CONST(LVar2, ANIM_Swooper_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim18) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_THREAD EVT_WAIT(30) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_END_THREAD - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim02) EVT_SET_CONST(LVar2, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -294,22 +295,22 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_CASE_EQ(EVENT_HIT) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(knockDown)) @@ -317,12 +318,12 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BURN_HIT) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim17) EVT_SET_CONST(LVar2, ANIM_Swooper_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim11) EVT_SET_CONST(LVar2, ANIM_Swooper_Anim12) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -331,65 +332,65 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BURN_DEATH) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim17) EVT_SET_CONST(LVar2, ANIM_Swooper_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim18) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim11) EVT_SET_CONST(LVar2, ANIM_Swooper_Anim12) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim12) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_IF EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ShockHit_Impl) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ShockHit_Impl) EVT_THREAD EVT_WAIT(30) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_END_THREAD - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_IF @@ -408,7 +409,7 @@ EvtScript N(handleEvent) = { EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, TRUE) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -24, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Anim02) EVT_SET_CONST(LVar2, ANIM_Swooper_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) diff --git a/src/battle/common/actor/swoopula.inc.c b/src/battle/common/actor/swoopula.inc.c index a866bb45f3..d83c556d25 100644 --- a/src/battle/common/actor/swoopula.inc.c +++ b/src/battle/common/actor/swoopula.inc.c @@ -1,10 +1,11 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" #include "sprite/npc/Swooper.h" #include "battle/action_cmd/stop_leech.h" +#define NAMESPACE A(swoopula) + extern EvtScript N(init); extern EvtScript N(idle); extern EvtScript N(takeTurn); @@ -157,77 +158,77 @@ EvtScript N(hadleEvent_flying) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim17) EVT_SET_CONST(LVar2, ANIM_Swooper_Gray_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim17) EVT_SET_CONST(LVar2, ANIM_Swooper_Gray_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim18) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) EVT_THREAD EVT_WAIT(30) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_END_THREAD - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim02) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim02) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim02) EVT_SET_CONST(LVar2, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -297,22 +298,22 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_IF EVT_CASE_EQ(EVENT_HIT) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(knockDown)) @@ -320,12 +321,12 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BURN_HIT) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim17) EVT_SET_CONST(LVar2, ANIM_Swooper_Gray_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim11) EVT_SET_CONST(LVar2, ANIM_Swooper_Gray_Anim12) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) @@ -334,65 +335,65 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_BURN_DEATH) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim17) EVT_SET_CONST(LVar2, ANIM_Swooper_Gray_Anim18) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim18) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim11) EVT_SET_CONST(LVar2, ANIM_Swooper_Gray_Anim12) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim12) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_IF EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ShockHit_Impl) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_EXEC_WAIT(N(returnHome)) EVT_CASE_EQ(EVENT_SHOCK_DEATH) EVT_CALL(func_80269470) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ShockHit_Impl) EVT_THREAD EVT_WAIT(30) EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_END_THREAD - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim0C) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) EVT_CALL(GetBattlePhase, LVar0) EVT_IF_EQ(LVar0, PHASE_FIRST_STRIKE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim0E) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_END_IF @@ -411,7 +412,7 @@ EvtScript N(handleEvent) = { EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, TRUE) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE) EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -24, 0) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Swooper_Gray_Anim02) EVT_SET_CONST(LVar2, ANIM_Swooper_Gray_Anim15) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) diff --git a/src/battle/common/actor/whacka.inc.c b/src/battle/common/actor/whacka.inc.c index 2d39826eeb..9ae2473ee1 100644 --- a/src/battle/common/actor/whacka.inc.c +++ b/src/battle/common/actor/whacka.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Whacka.h" +#define NAMESPACE A(whacka) + extern EvtScript N(init); extern EvtScript N(takeTurn); extern EvtScript N(idle); @@ -133,11 +134,11 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2073) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Hurt) EVT_EXEC_WAIT(N(spawnWhackasBump)) EVT_EXEC_WAIT(EVS_Enemy_Hit) @@ -147,7 +148,7 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_IF EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_SET_CONST(LVar2, ANIM_Whacka_Idle) EVT_EXEC_WAIT(N(spawnWhackasBump)) @@ -158,7 +159,7 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_IF EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_SET_CONST(LVar2, ANIM_Whacka_Idle) EVT_EXEC_WAIT(N(spawnWhackasBump)) @@ -167,13 +168,13 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(die)) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END_IF EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CALL(RandInt, 100, LVar0) @@ -182,42 +183,42 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_IF EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_IF_GE(100, 100) EVT_EXEC_WAIT(N(die)) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END_IF EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_ZERO_DAMAGE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CASE_EQ(EVENT_IMMUNE) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(RandInt, 100, LVar0) @@ -226,7 +227,7 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_IF EVT_CASE_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(RandInt, 100, LVar0) @@ -235,7 +236,7 @@ EvtScript N(handleEvent) = { EVT_RETURN EVT_END_IF EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Hurt) EVT_EXEC_WAIT(N(spawnWhackasBump)) EVT_EXEC_WAIT(EVS_Enemy_Hit) @@ -244,27 +245,27 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(die)) EVT_RETURN EVT_ELSE - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_END_IF EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_SET_CONST(LVar2, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Whacka_Idle) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/white_clubba.inc.c b/src/battle/common/actor/white_clubba.inc.c index 9fe026531e..ad753ec63d 100644 --- a/src/battle/common/actor/white_clubba.inc.c +++ b/src/battle/common/actor/white_clubba.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleClubba.h" +#define NAMESPACE A(white_clubba) + extern EvtScript N(init); extern EvtScript N(idle); extern EvtScript N(takeTurn); @@ -115,86 +116,86 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim06) EVT_SET_CONST(LVar2, ANIM_BattleClubba_Frost_Anim07) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim06) EVT_SET_CONST(LVar2, ANIM_BattleClubba_Frost_Anim07) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim07) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_JumpBack) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim02) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CASE_EQ(EVENT_SHOCK_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ShockHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim02) EVT_SET_CONST(LVar2, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_ScareAway) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -251,7 +252,7 @@ EvtScript N(takeTurn) = { EVT_CALL(YieldTurn) EVT_CALL(SetActorYaw, ACTOR_SELF, 180) EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim02) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) @@ -338,7 +339,7 @@ EvtScript N(takeTurn) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) EVT_WAIT(19) EVT_CALL(YieldTurn) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleClubba_Frost_Anim02) EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) EVT_END_CASE_GROUP diff --git a/src/battle/common/actor/white_magikoopa.inc.c b/src/battle/common/actor/white_magikoopa.inc.c index ce450fe838..4810e5f7ca 100644 --- a/src/battle/common/actor/white_magikoopa.inc.c +++ b/src/battle/common/actor/white_magikoopa.inc.c @@ -1,9 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/FlyingMagikoopa.h" #include "sprite/npc/Magikoopa.h" +#define NAMESPACE A(white_magikoopa) + extern s32 N(IdleAnimations_80223D70)[]; extern s32 N(IdleAnimations_80223DBC)[]; extern s32 N(IdleAnimations_80223E08)[]; @@ -235,54 +236,54 @@ EvtScript N(handleEvent_80223E24) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_White_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_White_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -296,7 +297,7 @@ EvtScript N(handleEvent_80223E24) = { EVT_EXEC_WAIT(N(run_away)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -308,7 +309,7 @@ EvtScript N(handleEvent_80223E24) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_MAIN, -4, 5, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -427,13 +428,13 @@ EvtScript N(handleEvent_80224A44) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(EVENT_HIT) EVT_CASE_OR_EQ(EVENT_FALL_TRIGGER) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(knockOff)) @@ -441,46 +442,46 @@ EvtScript N(handleEvent_80224A44) = { EVT_CASE_OR_EQ(EVENT_BURN_HIT) EVT_CASE_OR_EQ(EVENT_15) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_White_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(knockOff)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_White_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -495,7 +496,7 @@ EvtScript N(handleEvent_80224A44) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_FlyingMagikoopa_White_Anim01) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -509,7 +510,7 @@ EvtScript N(handleEvent_80224A44) = { EVT_EXEC_WAIT(N(run_away)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -521,7 +522,7 @@ EvtScript N(handleEvent_80224A44) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, -15, 0, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_White_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/yellow_magikoopa.inc.c b/src/battle/common/actor/yellow_magikoopa.inc.c index 0e1abaf1b3..66ccd6163d 100644 --- a/src/battle/common/actor/yellow_magikoopa.inc.c +++ b/src/battle/common/actor/yellow_magikoopa.inc.c @@ -1,10 +1,11 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" #include "sprite/npc/Magikoopa.h" #include "sprite/npc/FlyingMagikoopa.h" +#define NAMESPACE A(yellow_magikoopa) + extern s32 N(IdleAnimations)[]; extern s32 N(IdleAnimations_flying)[]; extern s32 N(80225248)[]; @@ -229,54 +230,54 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Yellow_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim05) EVT_SET_CONST(LVar2, ANIM_Magikoopa_Yellow_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -290,7 +291,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -302,7 +303,7 @@ EvtScript N(handleEvent) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_MAIN, -4, 5, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Magikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN @@ -421,13 +422,13 @@ EvtScript N(handleEvent_flying) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_OR_EQ(EVENT_HIT) EVT_CASE_OR_EQ(EVENT_FALL_TRIGGER) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_EXEC_WAIT(N(knockOff)) @@ -435,46 +436,46 @@ EvtScript N(handleEvent_flying) = { EVT_CASE_OR_EQ(EVENT_BURN_HIT) EVT_CASE_OR_EQ(EVENT_15) EVT_EXEC_WAIT(N(canBeKnockedOff)) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Yellow_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) EVT_EXEC_WAIT(N(knockOff)) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_BURN_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim05) EVT_SET_CONST(LVar2, ANIM_FlyingMagikoopa_Yellow_Anim06) EVT_EXEC_WAIT(EVS_Enemy_BurnHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim06) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim01) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_DEATH) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_WAIT(10) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_Death) EVT_RETURN @@ -489,7 +490,7 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetAnimation, ACTOR_SELF, PRT_2, ANIM_FlyingMagikoopa_Yellow_Anim01) EVT_CALL(HPBarToHome, ACTOR_SELF) EVT_CASE_EQ(EVENT_RECOVER_STATUS) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim01) EVT_EXEC_WAIT(EVS_Enemy_Recover) EVT_CASE_EQ(EVENT_SCARE_AWAY) @@ -503,7 +504,7 @@ EvtScript N(handleEvent_flying) = { EVT_EXEC_WAIT(N(flee)) EVT_RETURN EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim02) EVT_EXEC_WAIT(EVS_Enemy_AirLift) EVT_CASE_EQ(EVENT_BLOW_AWAY) @@ -515,7 +516,7 @@ EvtScript N(handleEvent_flying) = { EVT_CALL(SetPartDispOffset, ACTOR_SELF, PRT_2, -15, 0, 0) EVT_END_IF EVT_END_IF - EVT_SET_CONST(LVar0, 2) + EVT_SET_CONST(LVar0, PRT_2) EVT_SET_CONST(LVar1, ANIM_FlyingMagikoopa_Yellow_Anim04) EVT_EXEC_WAIT(EVS_Enemy_BlowAway) EVT_RETURN diff --git a/src/battle/common/actor/yellow_shy_guy.inc.c b/src/battle/common/actor/yellow_shy_guy.inc.c new file mode 100644 index 0000000000..0a0d4424ce --- /dev/null +++ b/src/battle/common/actor/yellow_shy_guy.inc.c @@ -0,0 +1,498 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/ShyGuy.h" + +#define NAMESPACE A(yellow_shy_guy) + +extern s32 N(IdleAnimations_8021C91C)[]; +extern EvtScript N(init_8021C968); +extern EvtScript N(takeTurn_8021E2B4); +extern EvtScript N(idle_8021C9B4); +extern EvtScript N(handleEvent_8021CB28); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_2 = 2, +}; + +s32 N(DefenseTable_8021C810)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_SHOCK, 0, + ELEMENT_END, +}; + +s32 N(StatusTable_8021C824)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 70, + STATUS_KEY_POISON, 50, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 90, + STATUS_KEY_FEAR, 100, + STATUS_KEY_STATIC, 50, + STATUS_KEY_PARALYZE, 90, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 90, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 1, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_MULTI_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 24 }, + .opacity = 255, + .idleAnimations = N(IdleAnimations_8021C91C), + .defenseTable = N(DefenseTable_8021C810), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { -1, -10 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = 0, + .type = ACTOR_TYPE_SHY_GUY, + .level = 14, + .maxHP = 7, + .partCount = ARRAY_COUNT( N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(init_8021C968), + .statusTable = N(StatusTable_8021C824), + .escapeChance = 60, + .airLiftChance = 85, + .hurricaneChance = 80, + .spookChance = 80, + .upAndAwayChance = 95, + .spinSmashReq = 0, + .powerBounceChance = 100, + .coinReward = 1, + .size = { 28, 24 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -10, 20 }, + .statusTextOffset = { 10, 20 }, +}; + +s32 N(IdleAnimations_8021C91C)[] = { + STATUS_KEY_NORMAL, ANIM_ShyGuy_Yellow_Anim01, + STATUS_KEY_STONE, ANIM_ShyGuy_Yellow_Anim00, + STATUS_KEY_SLEEP, ANIM_ShyGuy_Yellow_Anim12, + STATUS_KEY_POISON, ANIM_ShyGuy_Yellow_Anim01, + STATUS_KEY_STOP, ANIM_ShyGuy_Yellow_Anim00, + STATUS_KEY_STATIC, ANIM_ShyGuy_Yellow_Anim01, + STATUS_KEY_PARALYZE, ANIM_ShyGuy_Yellow_Anim00, + STATUS_KEY_DIZZY, ANIM_ShyGuy_Yellow_Anim13, + STATUS_KEY_FEAR, ANIM_ShyGuy_Yellow_Anim13, + STATUS_END, +}; + +EvtScript N(init_8021C968) = { + EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021E2B4))) + EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_8021C9B4))) + EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_8021CB28))) + EVT_RETURN + EVT_END +}; + +#include "common/battle/SetAbsoluteStatusOffsets.inc.c" + +EvtScript N(idle_8021C9B4) = { + EVT_LABEL(0) + EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) + EVT_IF_FLAG(LVar0, STATUS_FLAG_SLEEP) + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13) + EVT_ELSE + EVT_CALL(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24) + EVT_CALL(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -10) + EVT_CALL(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20) + EVT_END_IF + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021CAC4) = { + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim03) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) + EVT_RETURN + EVT_END +}; + +EvtScript N(handleEvent_8021CB28) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(GetLastEvent, ACTOR_SELF, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(EVENT_HIT_COMBO) + EVT_CASE_OR_EQ(EVENT_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_BURN_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Yellow_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_CASE_EQ(EVENT_BURN_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0D) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Yellow_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_BurnHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0E) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SPIN_SMASH_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_CASE_EQ(EVENT_SPIN_SMASH_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_SpinSmashHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_SHOCK_HIT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_JumpBack) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_EXEC_WAIT(N(8021CAC4)) + EVT_CASE_EQ(EVENT_SHOCK_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_ShockHit) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) + EVT_CASE_OR_EQ(EVENT_IMMUNE) + EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) + EVT_END_CASE_GROUP + EVT_CASE_EQ(EVENT_DEATH) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Hit) + EVT_WAIT(10) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_Death) + EVT_RETURN + EVT_CASE_EQ(EVENT_RECOVER_STATUS) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim01) + EVT_EXEC_WAIT(EVS_Enemy_Recover) + EVT_CASE_EQ(EVENT_SCARE_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim03) + EVT_SET_CONST(LVar2, ANIM_ShyGuy_Yellow_Anim14) + EVT_EXEC_WAIT(EVS_Enemy_ScareAway) + EVT_RETURN + EVT_CASE_EQ(EVENT_BEGIN_AIR_LIFT) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_AirLift) + EVT_CASE_EQ(EVENT_BLOW_AWAY) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim0C) + EVT_EXEC_WAIT(EVS_Enemy_BlowAway) + EVT_RETURN + EVT_CASE_DEFAULT + EVT_END_SWITCH + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021D004) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 50) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_2EF, 0) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_THREAD + EVT_WAIT(3) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_2EF) + EVT_END_THREAD + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim04) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim05) + EVT_WAIT(2) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_CALL(ResetAllActorSounds, ACTOR_SELF) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 30) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) + EVT_WAIT(8) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_EXEC_WAIT(N(8021CAC4)) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(8021D72C) = { + EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 0) + EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + EVT_CALL(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + EVT_CALL(BattleCamTargetActor, ACTOR_SELF) + EVT_CALL(MoveBattleCamOver, 20) + EVT_CALL(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_234) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim09) + EVT_WAIT(20) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim03) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 80) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_20BA, SOUND_3B4) + EVT_CALL(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim04) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0)) + EVT_SUB(LVar0, 40) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_10) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_MISS) + EVT_CASE_OR_EQ(HIT_RESULT_LUCKY) + EVT_SET(LVarA, LVar0) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim09) + EVT_THREAD + EVT_WAIT(12) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 10) + EVT_SET(LVar1, 0) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE) + EVT_IF_EQ(LVarA, HIT_RESULT_LUCKY) + EVT_CALL(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EVT_END_IF + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim05) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.5)) + EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_SUB(LVar0, 30) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_SUB(LVar0, 20) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE) + EVT_WAIT(15) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim09) + EVT_THREAD + EVT_WAIT(9) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim0A) + EVT_END_THREAD + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalToTarget, ACTOR_SELF) + EVT_CALL(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE) + EVT_WAIT(2) + EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_SP_EVT_ACTIVE) + EVT_SWITCH(LVar0) + EVT_CASE_OR_EQ(HIT_RESULT_HIT) + EVT_CASE_OR_EQ(HIT_RESULT_NO_DAMAGE) + EVT_CALL(UseBattleCamPreset, BTL_CAM_DEFAULT) + EVT_CALL(MoveBattleCamOver, 15) + EVT_THREAD + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0) + EVT_SET(LVar3, 0) + EVT_LOOP(20) + EVT_SUB(LVar3, 30) + EVT_IF_LT(LVar3, 0) + EVT_ADD(LVar3, 360) + EVT_END_IF + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0) + EVT_CALL(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(GetBattleFlags, LVar0) + EVT_IF_FLAG(LVar0, BS_FLAGS1_ATK_BLOCKED) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetLastDamage, ACTOR_PLAYER, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim09) + EVT_WAIT(10) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim07) + EVT_WAIT(15) + EVT_GOTO(2) + EVT_LABEL(1) + EVT_CALL(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 40) + EVT_SET(LVar1, 0) + EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.8)) + EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20E4) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim10) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_20C3) + EVT_CALL(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) + EVT_CALL(RandInt, 100, LVar0) + EVT_IF_LT(LVar0, 50) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim11) + EVT_ELSE + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim13) + EVT_END_IF + EVT_WAIT(25) + EVT_CALL(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + EVT_CALL(SetActorYaw, ACTOR_SELF, 180) + EVT_LABEL(2) + EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0)) + EVT_SET_CONST(LVar0, PRT_MAIN) + EVT_SET_CONST(LVar1, ANIM_ShyGuy_Yellow_Anim04) + EVT_EXEC_WAIT(EVS_Enemy_ReturnHome) + EVT_CALL(SetActorYaw, ACTOR_SELF, 0) + EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_ShyGuy_Yellow_Anim01) + EVT_END_CASE_GROUP + EVT_END_SWITCH + EVT_CALL(EnableIdleScript, ACTOR_SELF, 1) + EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(takeTurn_8021E2B4) = { + EVT_CALL(RandInt, 1, LVar0) + EVT_IF_EQ(LVar0, 0) + EVT_EXEC_WAIT(N(8021D004)) + EVT_ELSE + EVT_EXEC_WAIT(N(8021D72C)) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/stage/area_arn/arn_01.inc.c b/src/battle/common/stage/area_arn/arn_01.inc.c new file mode 100644 index 0000000000..bf7e4e3dc1 --- /dev/null +++ b/src/battle/common/stage/area_arn/arn_01.inc.c @@ -0,0 +1,31 @@ +#include "battle/battle.h" +#include "mapfs/arn_bt01_shape.h" + +#define NAMESPACE A(arn_01) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + -1, + MODEL_iwa4, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "arn_tex", + .shape = "arn_bt01_shape", + .hit = "arn_bt01_hit", + .bg = "arn_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_arn/arn_02.inc.c b/src/battle/common/stage/area_arn/arn_02.inc.c new file mode 100644 index 0000000000..6fa6557594 --- /dev/null +++ b/src/battle/common/stage/area_arn/arn_02.inc.c @@ -0,0 +1,48 @@ +#include "battle/battle.h" +#include "mapfs/arn_bt02_shape.h" + +#define NAMESPACE A(arn_02) + +EvtScript N(EVS_RotateWindmill) = { + EVT_SET(LVarA, LVar0) + EVT_SET(LVar0, 0) + EVT_LABEL(0) + EVT_ADD(LVar0, 1) + EVT_IF_GT(LVar0, 359) + EVT_SUB(LVar0, 360) + EVT_END_IF + EVT_CALL(RotateModel, LVarA, LVar0, 0, 0, 1) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_SET(LVar0, MODEL_o332) + EVT_EXEC_WAIT(N(EVS_RotateWindmill)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + -1, + MODEL_iwa4, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "arn_tex", + .shape = "arn_bt02_shape", + .hit = "arn_bt02_hit", + .bg = "arn_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_arn/arn_03.inc.c b/src/battle/common/stage/area_arn/arn_03.inc.c new file mode 100644 index 0000000000..af4bd37492 --- /dev/null +++ b/src/battle/common/stage/area_arn/arn_03.inc.c @@ -0,0 +1,31 @@ +#include "battle/battle.h" +#include "mapfs/arn_bt03_shape.h" + +#define NAMESPACE A(arn_03) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + -1, + MODEL_iwa4, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "arn_tex", + .shape = "arn_bt03_shape", + .hit = "arn_bt03_hit", + .bg = "arn_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_arn/arn_04.inc.c b/src/battle/common/stage/area_arn/arn_04.inc.c new file mode 100644 index 0000000000..09dec27fea --- /dev/null +++ b/src/battle/common/stage/area_arn/arn_04.inc.c @@ -0,0 +1,30 @@ +#include "battle/battle.h" +#include "mapfs/arn_bt04_shape.h" + +#define NAMESPACE A(arn_04) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o349, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "arn_tex", + .shape = "arn_bt04_shape", + .hit = "arn_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_arn/arn_05.inc.c b/src/battle/common/stage/area_arn/arn_05.inc.c new file mode 100644 index 0000000000..70f0cf8324 --- /dev/null +++ b/src/battle/common/stage/area_arn/arn_05.inc.c @@ -0,0 +1,30 @@ +#include "battle/battle.h" +#include "mapfs/arn_bt05_shape.h" + +#define NAMESPACE A(arn_05) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o354, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "arn_tex", + .shape = "arn_bt05_shape", + .hit = "arn_bt05_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_arn/arn_06.inc.c b/src/battle/common/stage/area_arn/arn_06.inc.c new file mode 100644 index 0000000000..0bdb973c77 --- /dev/null +++ b/src/battle/common/stage/area_arn/arn_06.inc.c @@ -0,0 +1,29 @@ +#include "battle/battle.h" +#include "mapfs/arn_bt06_shape.h" + +#define NAMESPACE A(arn_06) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_kabe3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "arn_tex", + .shape = "arn_bt06_shape", + .hit = "arn_bt06_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_dgb/dgb_01.inc.c b/src/battle/common/stage/area_dgb/dgb_01.inc.c new file mode 100644 index 0000000000..f983328a5b --- /dev/null +++ b/src/battle/common/stage/area_dgb/dgb_01.inc.c @@ -0,0 +1,23 @@ +#include "battle/battle.h" +#include "mapfs/dgb_bt01_shape.h" + +#define NAMESPACE A(dgb_01) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "dgb_tex", + .shape = "dgb_bt01_shape", + .hit = "dgb_bt01_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_dgb/dgb_02.inc.c b/src/battle/common/stage/area_dgb/dgb_02.inc.c new file mode 100644 index 0000000000..798f6f0a15 --- /dev/null +++ b/src/battle/common/stage/area_dgb/dgb_02.inc.c @@ -0,0 +1,23 @@ +#include "battle/battle.h" +#include "mapfs/dgb_bt02_shape.h" + +#define NAMESPACE A(dgb_02) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "dgb_tex", + .shape = "dgb_bt02_shape", + .hit = "dgb_bt02_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_dgb/dgb_03.inc.c b/src/battle/common/stage/area_dgb/dgb_03.inc.c new file mode 100644 index 0000000000..5fcbcc4833 --- /dev/null +++ b/src/battle/common/stage/area_dgb/dgb_03.inc.c @@ -0,0 +1,23 @@ +#include "battle/battle.h" +#include "mapfs/dgb_bt03_shape.h" + +#define NAMESPACE A(dgb_03) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "dgb_tex", + .shape = "dgb_bt03_shape", + .hit = "dgb_bt03_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_dgb/dgb_04.inc.c b/src/battle/common/stage/area_dgb/dgb_04.inc.c new file mode 100644 index 0000000000..06874b8a49 --- /dev/null +++ b/src/battle/common/stage/area_dgb/dgb_04.inc.c @@ -0,0 +1,29 @@ +#include "battle/battle.h" +#include "mapfs/dgb_bt04_shape.h" + +#define NAMESPACE A(dgb_04) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_kumo1, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "dgb_tex", + .shape = "dgb_bt04_shape", + .hit = "dgb_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_dgb/dgb_05.inc.c b/src/battle/common/stage/area_dgb/dgb_05.inc.c new file mode 100644 index 0000000000..a9b890f95e --- /dev/null +++ b/src/battle/common/stage/area_dgb/dgb_05.inc.c @@ -0,0 +1,23 @@ +#include "battle/battle.h" +#include "mapfs/dgb_bt05_shape.h" + +#define NAMESPACE A(dgb_05) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "dgb_tex", + .shape = "dgb_bt05_shape", + .hit = "dgb_bt05_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/flo_01.inc.c b/src/battle/common/stage/area_flo/flo_01.inc.c similarity index 74% rename from src/battle/common/stage/flo_01.inc.c rename to src/battle/common/stage/area_flo/flo_01.inc.c index 06f9aea290..4e80ce5236 100644 --- a/src/battle/common/stage/flo_01.inc.c +++ b/src/battle/common/stage/area_flo/flo_01.inc.c @@ -1,17 +1,18 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt01_shape.h" #include "effects.h" -#include "lib/RandomFlowers.inc.c" +#define NAMESPACE A(flo_01) + +#include "battle/common/stage/lib/RandomFlowers.inc.c" #include "common/MakeSun.inc.c" EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) - EVT_CALL(SetGroupVisibility, 37, MODEL_GROUP_VISIBLE) - EVT_CALL(SetGroupVisibility, 28, MODEL_GROUP_HIDDEN) - EVT_CALL(SetGroupVisibility, 22, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_dai_03, MODEL_GROUP_VISIBLE) + EVT_CALL(SetGroupVisibility, MODEL_dai_04, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_dai_05, MODEL_GROUP_HIDDEN) EVT_EXEC(N(EVS_RandomFlowers_Background)) EVT_EXEC_WAIT(N(MakeSun)) EVT_RETURN diff --git a/src/battle/common/stage/flo_01b.inc.c b/src/battle/common/stage/area_flo/flo_01b.inc.c similarity index 92% rename from src/battle/common/stage/flo_01b.inc.c rename to src/battle/common/stage/area_flo/flo_01b.inc.c index 196f2e22da..2b26a61c1a 100644 --- a/src/battle/common/stage/flo_01b.inc.c +++ b/src/battle/common/stage/area_flo/flo_01b.inc.c @@ -1,9 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt01_shape.h" #include "effects.h" -#include "lib/RandomFlowers.inc.c" +#define NAMESPACE A(flo_01b) + +#include "battle/common/stage/lib/RandomFlowers.inc.c" #include "common/MakeSun.inc.c" EvtScript N(EVS_PreBattle) = { diff --git a/src/battle/common/stage/flo_01c.inc.c b/src/battle/common/stage/area_flo/flo_01c.inc.c similarity index 92% rename from src/battle/common/stage/flo_01c.inc.c rename to src/battle/common/stage/area_flo/flo_01c.inc.c index 975107d5a0..62d9c7475b 100644 --- a/src/battle/common/stage/flo_01c.inc.c +++ b/src/battle/common/stage/area_flo/flo_01c.inc.c @@ -1,9 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt01_shape.h" #include "effects.h" -#include "lib/RandomFlowers.inc.c" +#define NAMESPACE A(flo_01c) + +#include "battle/common/stage/lib/RandomFlowers.inc.c" #include "common/MakeSun.inc.c" EvtScript N(EVS_PreBattle) = { diff --git a/src/battle/common/stage/flo_02.inc.c b/src/battle/common/stage/area_flo/flo_02.inc.c similarity index 91% rename from src/battle/common/stage/flo_02.inc.c rename to src/battle/common/stage/area_flo/flo_02.inc.c index 8480e1434a..36137fba41 100644 --- a/src/battle/common/stage/flo_02.inc.c +++ b/src/battle/common/stage/area_flo/flo_02.inc.c @@ -1,9 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt02_shape.h" #include "effects.h" -#include "lib/RandomFlowers.inc.c" +#define NAMESPACE A(flo_02) + +#include "battle/common/stage/lib/RandomFlowers.inc.c" #include "common/MakeSun.inc.c" EvtScript N(EVS_PreBattle) = { diff --git a/src/battle/common/stage/flo_02b.inc.c b/src/battle/common/stage/area_flo/flo_02b.inc.c similarity index 92% rename from src/battle/common/stage/flo_02b.inc.c rename to src/battle/common/stage/area_flo/flo_02b.inc.c index 42ae43d055..83275941a2 100644 --- a/src/battle/common/stage/flo_02b.inc.c +++ b/src/battle/common/stage/area_flo/flo_02b.inc.c @@ -1,9 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt02_shape.h" #include "effects.h" -#include "lib/RandomFlowers.inc.c" +#define NAMESPACE A(flo_02b) + +#include "battle/common/stage/lib/RandomFlowers.inc.c" #include "common/MakeSun.inc.c" EvtScript N(EVS_PreBattle) = { diff --git a/src/battle/common/stage/flo_02c.inc.c b/src/battle/common/stage/area_flo/flo_02c.inc.c similarity index 92% rename from src/battle/common/stage/flo_02c.inc.c rename to src/battle/common/stage/area_flo/flo_02c.inc.c index 578cb9b456..9ff0ec61d2 100644 --- a/src/battle/common/stage/flo_02c.inc.c +++ b/src/battle/common/stage/area_flo/flo_02c.inc.c @@ -1,9 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt02_shape.h" #include "effects.h" -#include "lib/RandomFlowers.inc.c" +#define NAMESPACE A(flo_02c) + +#include "battle/common/stage/lib/RandomFlowers.inc.c" #include "common/MakeSun.inc.c" EvtScript N(EVS_PreBattle) = { diff --git a/src/battle/common/stage/flo_03.inc.c b/src/battle/common/stage/area_flo/flo_03.inc.c similarity index 99% rename from src/battle/common/stage/flo_03.inc.c rename to src/battle/common/stage/area_flo/flo_03.inc.c index 3ed5f43ca3..ddd4793264 100644 --- a/src/battle/common/stage/flo_03.inc.c +++ b/src/battle/common/stage/area_flo/flo_03.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt03_shape.h" +#define NAMESPACE A(flo_03) + EvtScript N(EVS_AnimateVines) = { EVT_SET(LVarA, LVar0) EVT_USE_BUF(LVarA) diff --git a/src/battle/common/stage/flo_04.inc.c b/src/battle/common/stage/area_flo/flo_04.inc.c similarity index 98% rename from src/battle/common/stage/flo_04.inc.c rename to src/battle/common/stage/area_flo/flo_04.inc.c index 93d75a0ef4..d0f90d9239 100644 --- a/src/battle/common/stage/flo_04.inc.c +++ b/src/battle/common/stage/area_flo/flo_04.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt04_shape.h" +#define NAMESPACE A(flo_04) + #include "common/CosInterpMinMax.inc.c" EvtScript N(EVS_AnimateCloud) = { diff --git a/src/battle/common/stage/flo_05.inc.c b/src/battle/common/stage/area_flo/flo_05.inc.c similarity index 94% rename from src/battle/common/stage/flo_05.inc.c rename to src/battle/common/stage/area_flo/flo_05.inc.c index d81b379c77..1235dd2ab0 100644 --- a/src/battle/common/stage/flo_05.inc.c +++ b/src/battle/common/stage/area_flo/flo_05.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt05_shape.h" +#define NAMESPACE A(flo_05) + #include "common/MakeSun.inc.c" EvtScript N(EVS_PreBattle) = { diff --git a/src/battle/common/stage/flo_06.inc.c b/src/battle/common/stage/area_flo/flo_06.inc.c similarity index 94% rename from src/battle/common/stage/flo_06.inc.c rename to src/battle/common/stage/area_flo/flo_06.inc.c index 3f0e37dddc..e35fed0f3a 100644 --- a/src/battle/common/stage/flo_06.inc.c +++ b/src/battle/common/stage/area_flo/flo_06.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/flo_bt06_shape.h" +#define NAMESPACE A(flo_06) + #include "common/MakeSun.inc.c" EvtScript N(EVS_PreBattle) = { diff --git a/src/battle/common/stage/area_hos/hos_00.inc.c b/src/battle/common/stage/area_hos/hos_00.inc.c new file mode 100644 index 0000000000..3a2c363394 --- /dev/null +++ b/src/battle/common/stage/area_hos/hos_00.inc.c @@ -0,0 +1,81 @@ +#include "battle/battle.h" +#include "mapfs/nok_bt02_shape.h" + +#define NAMESPACE A(hos_00) + +EvtScript N(EVS_AnimateFlower) = { + EVT_SET(LVarA, LVar0) + EVT_LABEL(0) + EVT_CALL(TranslateModel, LVarA, 0, 2, 0) + EVT_WAIT(5) + EVT_CALL(TranslateModel, LVarA, 0, 0, 0) + EVT_WAIT(5) + EVT_CALL(TranslateModel, LVarA, 0, 2, 0) + EVT_WAIT(5) + EVT_CALL(TranslateModel, LVarA, 0, 0, 0) + EVT_WAIT(5) + EVT_CALL(RandInt, 30, LVar0) + EVT_ADD(LVar0, 30) + EVT_WAIT(LVar0) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_THREAD + EVT_SET(LVar0, MODEL_h1) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h3) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h4) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h5) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h6) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h7) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h9) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h10) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h11) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h12) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_END_THREAD + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_hap, + MODEL_kusa3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "nok_tex", + .shape = "nok_bt02_shape", + .hit = "nok_bt02_hit", + .bg = "nok_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_hos/hos_01.inc.c b/src/battle/common/stage/area_hos/hos_01.inc.c new file mode 100644 index 0000000000..e8ee03ccd0 --- /dev/null +++ b/src/battle/common/stage/area_hos/hos_01.inc.c @@ -0,0 +1,267 @@ +#include "battle/battle.h" +#include "mapfs/hos_bt01_shape.h" + +#define NAMESPACE A(hos_01) + +u16 N(StarPhaseAngles)[16] = {}; + +void N(build_gfx_yellow_stars)(s32 index) { + Vtx* firstVertex; + Vtx* copiedVertices; + s32 numVertices; + s32 i; + s32 temp3; + + index--; + mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices); + + for (i = 0; i < numVertices; i++) { + Vtx* vtx = &copiedVertices[i]; + s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2; + s32 temp2 = temp1 * 155; + vtx->v.cn[0] = temp2 / 0x8000 + 100; + vtx->v.cn[1] = temp2 / 0x8000 + 100; + + temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000; + vtx->v.cn[2] = vtx->v.cn[0] * temp3 / 0x10000; + } + + gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index)); + N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898); +} + +void N(build_gfx_blue_stars)(s32 index) { + Vtx* firstVertex; + Vtx* copiedVertices; + s32 numVertices; + s32 i; + s32 temp3; + + index--; + mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices); + + for (i = 0; i < numVertices; i++) { + u8* colors = copiedVertices[i].v.cn; + s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2; + colors[0] = temp1 * 155 / 0x8000 + 48.62745098039216; + colors[1] = temp1 * 155 / 0x8000 + 89.41176470588236; + + temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000; + colors[2] = colors[0] * temp3 / 0x10000 + 99.6078431372549; + } + + gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index)); + N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898); +} + +void N(build_gfx_green_stars)(s32 index) { + Vtx* firstVertex; + Vtx* copiedVertices; + s32 numVertices; + s32 i; + s32 temp3; + + index--; + mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices); + + for (i = 0; i < numVertices; i++) { + u8* colors = copiedVertices[i].v.cn; + s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2; + colors[0] = temp1 * 155 / 0x8000 + 67.45098039215686; + colors[1] = temp1 * 155 / 0x8000 + 100.0; + + temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000; + colors[2] = colors[0] * temp3 / 0x10000 + 59.21568627450981; + } + + gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index)); + N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898); +} + +void N(build_gfx_pink_stars)(s32 index) { + Vtx* firstVertex; + Vtx* copiedVertices; + s32 numVertices; + s32 i; + s32 temp3; + + index--; + mdl_get_copied_vertices(index, &firstVertex, &copiedVertices, &numVertices); + + for (i = 0; i < numVertices; i++) { + u8* colors = copiedVertices[i].v.cn; + s16 temp1 = (sins(N(StarPhaseAngles)[index] * (i % 3 + 1) + i) + 0x8000) / 2; + colors[0] = temp1 * 155 / 0x8000 + 100.0; + colors[1] = temp1 * 155 / 0x8000 + 80.3921568627451; + + temp3 = sins(N(StarPhaseAngles)[index] / 0x8000 * (((i / 2) % 3 + 1) << 15) + N(StarPhaseAngles)[index] / 0x4000 * 0x8000 + i) + 0x8000; + colors[2] = colors[0] * temp3 / 0x10000 + 96.07843137254902; + } + + gSPDisplayList(gMainGfxPos++, mdl_get_copied_gfx(index)); + N(StarPhaseAngles)[index] += (s32)RAD_TO_BINANG(25.1898); +} + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o345, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_yellow_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o345, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o345, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o338, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(build_gfx_yellow_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o338, CUSTOM_GFX_2, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o338, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_o344, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(build_gfx_yellow_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o344, CUSTOM_GFX_3, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o344, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_3, MODEL_o354, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_4, EVT_PTR(N(build_gfx_yellow_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o354, CUSTOM_GFX_4, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o354, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_4, MODEL_o341, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_5, EVT_PTR(N(build_gfx_yellow_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o341, CUSTOM_GFX_5, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o341, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_5, MODEL_o352, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_6, EVT_PTR(N(build_gfx_blue_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o352, CUSTOM_GFX_6, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o352, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_6, MODEL_o346, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_7, EVT_PTR(N(build_gfx_blue_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o346, CUSTOM_GFX_7, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o346, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_7, MODEL_o349, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_8, EVT_PTR(N(build_gfx_green_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o349, CUSTOM_GFX_8, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o349, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_8, MODEL_o353, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_9, EVT_PTR(N(build_gfx_green_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o353, CUSTOM_GFX_9, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o353, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_CALL(MakeLocalVertexCopy, VTX_COPY_9, MODEL_o347, TRUE) + EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_A, EVT_PTR(N(build_gfx_pink_stars)), NULL) + EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_A, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelFlags, MODEL_o347, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) + + EVT_THREAD + EVT_CALL(SetTexPanner, MODEL_o332, TEX_PANNER_0) + EVT_CALL(SetTexPanner, MODEL_o334, TEX_PANNER_0) + EVT_CALL(SetTexPanner, MODEL_o333, TEX_PANNER_0) + EVT_CALL(SetTexPanner, MODEL_o336, TEX_PANNER_0) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_SET(LVar2, 0) + EVT_SET(LVar3, 0) + EVT_LOOP(0) + EVT_ADD(LVar0, 80) + EVT_ADD(LVar1, -150) + EVT_IF_GT(LVar0, 0x8000) + EVT_ADD(LVar0, -0x8000) + EVT_END_IF + EVT_IF_LT(LVar1, -0x8000) + EVT_ADD(LVar1, 0x8000) + EVT_END_IF + EVT_ADD(LVar2, -50) + EVT_ADD(LVar3, 100) + EVT_IF_LT(LVar2, -0x8000) + EVT_ADD(LVar2, 0x8000) + EVT_END_IF + EVT_IF_GT(LVar3, 0x8000) + EVT_ADD(LVar3, -0x8000) + EVT_END_IF + EVT_CALL(SetTexPanOffset, TEX_PANNER_0, TEX_PANNER_MAIN, LVar0, LVar1) + EVT_CALL(SetTexPanOffset, TEX_PANNER_0, TEX_PANNER_AUX, LVar2, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_LABEL(2) + EVT_CALL(MakeLerp, -7, 7, 30, EASING_COS_IN_OUT) + EVT_LABEL(0) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, MODEL_o357, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o344, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o361, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o354, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o341, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o362, 0, LVar0, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(MakeLerp, 7, -7, 30, EASING_COS_IN_OUT) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, MODEL_o357, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o344, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o361, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o354, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o341, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o362, 0, LVar0, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_GOTO(2) + EVT_END_THREAD + EVT_THREAD + EVT_LABEL(3) + EVT_CALL(MakeLerp, 7, -7, 30, EASING_COS_IN_OUT) + EVT_LABEL(4) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, MODEL_o363, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o343, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o355, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o338, 0, LVar0, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(4) + EVT_END_IF + EVT_CALL(MakeLerp, -7, 7, 30, EASING_COS_IN_OUT) + EVT_LABEL(5) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, MODEL_o363, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o343, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o355, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o338, 0, LVar0, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(5) + EVT_END_IF + EVT_GOTO(3) + EVT_END_THREAD + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o345, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "hos_tex\0", + .shape = "hos_bt01_shape", + .hit = "hos_bt01_hit", + .bg = "hos_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_hos/hos_02.inc.c b/src/battle/common/stage/area_hos/hos_02.inc.c new file mode 100644 index 0000000000..6c1fae159b --- /dev/null +++ b/src/battle/common/stage/area_hos/hos_02.inc.c @@ -0,0 +1,102 @@ +#include "battle/battle.h" +#include "mapfs/hos_bt02_shape.h" + +#define NAMESPACE A(hos_02) + +EvtScript N(EVS_PreBattle) = { + EVT_THREAD + EVT_CALL(SetTexPanner, MODEL_o372, TEX_PANNER_1) + EVT_CALL(SetTexPanner, MODEL_o375, TEX_PANNER_1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_SET(LVar2, 0) + EVT_SET(LVar3, 0) + EVT_LOOP(0) + EVT_ADD(LVar0, -50) + EVT_ADD(LVar1, 300) + EVT_ADD(LVar2, 90) + EVT_ADD(LVar3, -200) + EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) + EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_AUX, LVar2, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_THREAD + EVT_SET(LVarA, 0) + EVT_LABEL(2) + EVT_CALL(MakeLerp, -7, 7, 40, EASING_COS_IN_OUT) + EVT_LABEL(0) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, MODEL_o371, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o372, 0, LVar0, 0) + EVT_MUL(LVar0, 3) + EVT_CALL(RotateModel, MODEL_o371, LVarA, 0, 0, 1) + EVT_ADD(LVarA, -3) + EVT_CALL(ClampAngleFloat, LVarA) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(MakeLerp, 7, -7, 40, EASING_COS_IN_OUT) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, MODEL_o371, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o372, 0, LVar0, 0) + EVT_MUL(LVar0, 3) + EVT_CALL(RotateModel, MODEL_o371, LVarA, 0, 0, 1) + EVT_ADD(LVarA, -3) + EVT_CALL(ClampAngleFloat, LVarA) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_GOTO(2) + EVT_END_THREAD + EVT_THREAD + EVT_SET(LVarA, 0) + EVT_LABEL(2) + EVT_CALL(MakeLerp, -10, 4, 40, EASING_COS_IN_OUT) + EVT_LABEL(0) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, MODEL_o376, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o375, 0, LVar0, 0) + EVT_MUL(LVar0, -3) + EVT_CALL(RotateModel, MODEL_o376, LVarA, 0, 0, 1) + EVT_ADD(LVarA, -3) + EVT_CALL(ClampAngleFloat, LVarA) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(MakeLerp, 4, -10, 40, EASING_COS_IN_OUT) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, MODEL_o376, 0, LVar0, 0) + EVT_CALL(TranslateModel, MODEL_o375, 0, LVar0, 0) + EVT_MUL(LVar0, -3) + EVT_CALL(RotateModel, MODEL_o376, LVarA, 0, 0, 1) + EVT_ADD(LVarA, -3) + EVT_CALL(ClampAngleFloat, LVarA) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_GOTO(2) + EVT_END_THREAD + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "hos_tex", + .shape = "hos_bt02_shape", + .hit = "hos_bt02_hit", + .bg = "nok_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/isk_00.inc.c b/src/battle/common/stage/area_isk/isk_00.inc.c similarity index 93% rename from src/battle/common/stage/isk_00.inc.c rename to src/battle/common/stage/area_isk/isk_00.inc.c index 6b79ee8d60..979c418035 100644 --- a/src/battle/common/stage/isk_00.inc.c +++ b/src/battle/common/stage/area_isk/isk_00.inc.c @@ -1,6 +1,7 @@ -#include "common.h" #include "battle/battle.h" +#define NAMESPACE A(isk_00) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/isk_01.inc.c b/src/battle/common/stage/area_isk/isk_01.inc.c similarity index 94% rename from src/battle/common/stage/isk_01.inc.c rename to src/battle/common/stage/area_isk/isk_01.inc.c index 4e78cd6acd..68e8d1a5c3 100644 --- a/src/battle/common/stage/isk_01.inc.c +++ b/src/battle/common/stage/area_isk/isk_01.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt01_shape.h" +#define NAMESPACE A(isk_01) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/isk_02.inc.c b/src/battle/common/stage/area_isk/isk_02.inc.c similarity index 95% rename from src/battle/common/stage/isk_02.inc.c rename to src/battle/common/stage/area_isk/isk_02.inc.c index c223afad11..68d2801764 100644 --- a/src/battle/common/stage/isk_02.inc.c +++ b/src/battle/common/stage/area_isk/isk_02.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt02_shape.h" +#define NAMESPACE A(isk_02) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_BTL_ISK) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/isk_02b.inc.c b/src/battle/common/stage/area_isk/isk_02b.inc.c similarity index 96% rename from src/battle/common/stage/isk_02b.inc.c rename to src/battle/common/stage/area_isk/isk_02b.inc.c index 6abb7e5f4a..eee9e990cf 100644 --- a/src/battle/common/stage/isk_02b.inc.c +++ b/src/battle/common/stage/area_isk/isk_02b.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt02_shape.h" +#define NAMESPACE A(isk_02b) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/isk_02c.inc.c b/src/battle/common/stage/area_isk/isk_02c.inc.c similarity index 95% rename from src/battle/common/stage/isk_02c.inc.c rename to src/battle/common/stage/area_isk/isk_02c.inc.c index d6ef2eb2a0..92ba573078 100644 --- a/src/battle/common/stage/isk_02c.inc.c +++ b/src/battle/common/stage/area_isk/isk_02c.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt02_shape.h" +#define NAMESPACE A(isk_02c) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/isk_03.inc.c b/src/battle/common/stage/area_isk/isk_03.inc.c similarity index 94% rename from src/battle/common/stage/isk_03.inc.c rename to src/battle/common/stage/area_isk/isk_03.inc.c index 6d068cce64..d177ff8746 100644 --- a/src/battle/common/stage/isk_03.inc.c +++ b/src/battle/common/stage/area_isk/isk_03.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt03_shape.h" +#define NAMESPACE A(isk_03) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/isk_03b.inc.c b/src/battle/common/stage/area_isk/isk_03b.inc.c similarity index 93% rename from src/battle/common/stage/isk_03b.inc.c rename to src/battle/common/stage/area_isk/isk_03b.inc.c index 24830cc4d0..822437b30f 100644 --- a/src/battle/common/stage/isk_03b.inc.c +++ b/src/battle/common/stage/area_isk/isk_03b.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt03_shape.h" +#define NAMESPACE A(isk_03b) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/isk_04.inc.c b/src/battle/common/stage/area_isk/isk_04.inc.c similarity index 97% rename from src/battle/common/stage/isk_04.inc.c rename to src/battle/common/stage/area_isk/isk_04.inc.c index 95c7333f26..8e05939e6b 100644 --- a/src/battle/common/stage/isk_04.inc.c +++ b/src/battle/common/stage/area_isk/isk_04.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt04_shape.h" #include "effects.h" +#define NAMESPACE A(isk_04) + BSS EffectInstance* N(TorchFlameL); BSS EffectInstance* N(TorchFlameR); diff --git a/src/battle/common/stage/isk_05.inc.c b/src/battle/common/stage/area_isk/isk_05.inc.c similarity index 97% rename from src/battle/common/stage/isk_05.inc.c rename to src/battle/common/stage/area_isk/isk_05.inc.c index c2e9bdf4cc..399a538637 100644 --- a/src/battle/common/stage/isk_05.inc.c +++ b/src/battle/common/stage/area_isk/isk_05.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt05_shape.h" #include "effects.h" +#define NAMESPACE A(isk_05) + BSS EffectInstance* N(TorchFlameL); BSS EffectInstance* N(TorchFlameR); diff --git a/src/battle/common/stage/isk_06.inc.c b/src/battle/common/stage/area_isk/isk_06.inc.c similarity index 96% rename from src/battle/common/stage/isk_06.inc.c rename to src/battle/common/stage/area_isk/isk_06.inc.c index a4f3b4d604..3d7fc61e34 100644 --- a/src/battle/common/stage/isk_06.inc.c +++ b/src/battle/common/stage/area_isk/isk_06.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt06_shape.h" #include "effects.h" +#define NAMESPACE A(isk_06) + BSS EffectInstance* N(TorchFlame); API_CALLABLE(N(CreateTorchFX)) { diff --git a/src/battle/common/stage/isk_06b.inc.c b/src/battle/common/stage/area_isk/isk_06b.inc.c similarity index 96% rename from src/battle/common/stage/isk_06b.inc.c rename to src/battle/common/stage/area_isk/isk_06b.inc.c index 3e6f664572..9aeec04a5b 100644 --- a/src/battle/common/stage/isk_06b.inc.c +++ b/src/battle/common/stage/area_isk/isk_06b.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt06_shape.h" #include "effects.h" +#define NAMESPACE A(isk_06b) + BSS EffectInstance* N(TorchFlame); API_CALLABLE(N(CreateTorchFX)) { diff --git a/src/battle/common/stage/isk_07.inc.c b/src/battle/common/stage/area_isk/isk_07.inc.c similarity index 96% rename from src/battle/common/stage/isk_07.inc.c rename to src/battle/common/stage/area_isk/isk_07.inc.c index 6657228558..0bbc7c15fd 100644 --- a/src/battle/common/stage/isk_07.inc.c +++ b/src/battle/common/stage/area_isk/isk_07.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt07_shape.h" #include "effects.h" +#define NAMESPACE A(isk_07) + BSS EffectInstance* N(TorchFlame); API_CALLABLE(N(CreateTorchFX)) { diff --git a/src/battle/common/stage/isk_08.inc.c b/src/battle/common/stage/area_isk/isk_08.inc.c similarity index 96% rename from src/battle/common/stage/isk_08.inc.c rename to src/battle/common/stage/area_isk/isk_08.inc.c index 14f17aff01..ffe91d740a 100644 --- a/src/battle/common/stage/isk_08.inc.c +++ b/src/battle/common/stage/area_isk/isk_08.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/isk_bt06_shape.h" #include "effects.h" +#define NAMESPACE A(isk_08) + BSS EffectInstance* N(TorchFlame); API_CALLABLE(N(CreateTorchFX)) { diff --git a/src/battle/common/stage/area_iwa/iwa_01.inc.c b/src/battle/common/stage/area_iwa/iwa_01.inc.c new file mode 100644 index 0000000000..28c09e0553 --- /dev/null +++ b/src/battle/common/stage/area_iwa/iwa_01.inc.c @@ -0,0 +1,51 @@ +#include "battle/battle.h" +#include "mapfs/iwa_bt01_shape.h" + +#define NAMESPACE A(iwa_01) + +// this (unused) whacka is part of the stage +extern ActorBlueprint N(whacka); +extern Formation N(WhackaFormation); + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetGroupVisibility, MODEL_b, MODEL_GROUP_HIDDEN) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_iwa1, + MODEL_o331, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "iwa_tex", + .shape = "iwa_bt01_shape", + .hit = "iwa_bt01_hit", + .bg = "iwa_bg\0", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), + .stageEnemyCount = 1, + .stageFormation = &N(WhackaFormation), + .stageEnemyChance = 512, +}; + +Vec3i N(WhackaPos) = { 116, 0, -30 }; + +Formation N(WhackaFormation) = { + ACTOR_BY_POS(N(whacka), N(WhackaPos), 0), +}; + +// needs to match stage name used while defining NAMESPACE above +// the actor include redefines NAMESPACE based on current AREA, so we need to insert the stage name via prefix +#define NAME_PREFIX iwa_01_ +#include "battle/common/actor/whacka.inc.c" +#define NAME_PREFIX diff --git a/src/battle/common/stage/area_iwa/iwa_01b.inc.c b/src/battle/common/stage/area_iwa/iwa_01b.inc.c new file mode 100644 index 0000000000..47e729d4de --- /dev/null +++ b/src/battle/common/stage/area_iwa/iwa_01b.inc.c @@ -0,0 +1,32 @@ +#include "battle/battle.h" +#include "mapfs/iwa_bt01_shape.h" + +#define NAMESPACE A(iwa_01b) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetGroupVisibility, MODEL_a, MODEL_GROUP_HIDDEN) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_iwa1, + MODEL_o331, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "iwa_tex", + .shape = "iwa_bt01_shape", + .hit = "iwa_bt01_hit", + .bg = "iwa_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_iwa/iwa_02.inc.c b/src/battle/common/stage/area_iwa/iwa_02.inc.c new file mode 100644 index 0000000000..e822a7e5e2 --- /dev/null +++ b/src/battle/common/stage/area_iwa/iwa_02.inc.c @@ -0,0 +1,46 @@ +#include "battle/battle.h" +#include "mapfs/iwa_bt02_shape.h" + +#define NAMESPACE A(iwa_02) + +// this (unused) whacka is part of the stage +extern ActorBlueprint N(whacka); + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o331, + MODEL_iwa1, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "iwa_tex", + .shape = "iwa_bt02_shape", + .hit = "iwa_bt02_hit", + .bg = "iwa_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; + +Vec3i N(OriginPos) = { 0, 0, 0 }; + +Formation N(WhackaFormation) = { + ACTOR_BY_POS(N(whacka), N(OriginPos), 0), +}; + +// needs to match stage name used while defining NAMESPACE above +// the actor include redefines NAMESPACE based on current AREA, so we need to insert the stage name via prefix +#define NAME_PREFIX iwa_02_ +#include "battle/common/actor/whacka.inc.c" +#define NAME_PREFIX diff --git a/src/battle/common/stage/jan_00.inc.c b/src/battle/common/stage/area_jan/jan_00.inc.c similarity index 90% rename from src/battle/common/stage/jan_00.inc.c rename to src/battle/common/stage/area_jan/jan_00.inc.c index 99ab4d5474..ade8218a63 100644 --- a/src/battle/common/stage/jan_00.inc.c +++ b/src/battle/common/stage/area_jan/jan_00.inc.c @@ -1,9 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/jan_bt00_shape.h" #include "effects.h" -#include "lib/BeachEffects.inc.c" +#define NAMESPACE A(jan_00) + +#include "battle/common/stage/lib/BeachEffects.inc.c" EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) diff --git a/src/battle/common/stage/jan_01.inc.c b/src/battle/common/stage/area_jan/jan_01.inc.c similarity index 92% rename from src/battle/common/stage/jan_01.inc.c rename to src/battle/common/stage/area_jan/jan_01.inc.c index 27e7709f5a..15124d4862 100644 --- a/src/battle/common/stage/jan_01.inc.c +++ b/src/battle/common/stage/area_jan/jan_01.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/jan_bt01_shape.h" -#include "lib/BeachEffects.inc.c" +#define NAMESPACE A(jan_01) + +#include "battle/common/stage/lib/BeachEffects.inc.c" EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) diff --git a/src/battle/common/stage/jan_01b.inc.c b/src/battle/common/stage/area_jan/jan_01b.inc.c similarity index 92% rename from src/battle/common/stage/jan_01b.inc.c rename to src/battle/common/stage/area_jan/jan_01b.inc.c index 0fe4e36b95..5c4b7c88a4 100644 --- a/src/battle/common/stage/jan_01b.inc.c +++ b/src/battle/common/stage/area_jan/jan_01b.inc.c @@ -1,8 +1,9 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/jan_bt01_shape.h" -#include "lib/BeachEffects.inc.c" +#define NAMESPACE A(jan_01b) + +#include "battle/common/stage/lib/BeachEffects.inc.c" EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) diff --git a/src/battle/common/stage/jan_02.inc.c b/src/battle/common/stage/area_jan/jan_02.inc.c similarity index 95% rename from src/battle/common/stage/jan_02.inc.c rename to src/battle/common/stage/area_jan/jan_02.inc.c index cd20c8a159..0e9b3129a0 100644 --- a/src/battle/common/stage/jan_02.inc.c +++ b/src/battle/common/stage/area_jan/jan_02.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/jan_bt02_shape.h" +#define NAMESPACE A(jan_02) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/jan_03.inc.c b/src/battle/common/stage/area_jan/jan_03.inc.c similarity index 96% rename from src/battle/common/stage/jan_03.inc.c rename to src/battle/common/stage/area_jan/jan_03.inc.c index 9eb50e3643..c3dd19be28 100644 --- a/src/battle/common/stage/jan_03.inc.c +++ b/src/battle/common/stage/area_jan/jan_03.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/jan_bt03_shape.h" +#define NAMESPACE A(jan_03) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/jan_03b.inc.c b/src/battle/common/stage/area_jan/jan_03b.inc.c similarity index 95% rename from src/battle/common/stage/jan_03b.inc.c rename to src/battle/common/stage/area_jan/jan_03b.inc.c index e77dc414f4..2e1c1f3a4c 100644 --- a/src/battle/common/stage/jan_03b.inc.c +++ b/src/battle/common/stage/area_jan/jan_03b.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/jan_bt03_shape.h" +#define NAMESPACE A(jan_03b) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/jan_04.inc.c b/src/battle/common/stage/area_jan/jan_04.inc.c similarity index 95% rename from src/battle/common/stage/jan_04.inc.c rename to src/battle/common/stage/area_jan/jan_04.inc.c index 54d0051215..47dca82b59 100644 --- a/src/battle/common/stage/jan_04.inc.c +++ b/src/battle/common/stage/area_jan/jan_04.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/jan_bt04_shape.h" +#define NAMESPACE A(jan_04) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/jan_04b.inc.c b/src/battle/common/stage/area_jan/jan_04b.inc.c similarity index 95% rename from src/battle/common/stage/jan_04b.inc.c rename to src/battle/common/stage/area_jan/jan_04b.inc.c index 87e8f51b05..c93f598e89 100644 --- a/src/battle/common/stage/jan_04b.inc.c +++ b/src/battle/common/stage/area_jan/jan_04b.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/jan_bt04_shape.h" +#define NAMESPACE A(jan_04b) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) diff --git a/src/battle/common/stage/area_kgr/kgr_01.inc.c b/src/battle/common/stage/area_kgr/kgr_01.inc.c new file mode 100644 index 0000000000..fc71977dd9 --- /dev/null +++ b/src/battle/common/stage/area_kgr/kgr_01.inc.c @@ -0,0 +1,66 @@ +#include "battle/battle.h" +#include "mapfs/kgr_bt01_shape.h" + +#define NAMESPACE A(kgr_01) + +#include "battle/common/stage/lib/WaterEffects.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_THREAD + EVT_SET(LVar0, MODEL_bin1) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_WAIT(4) + EVT_SET(LVar0, MODEL_bin2) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_WAIT(4) + EVT_SET(LVar0, MODEL_bin3) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_WAIT(4) + EVT_SET(LVar0, MODEL_bin4) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_END_THREAD + EVT_THREAD + EVT_SET(LVar0, MODEL_hako1) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_WAIT(4) + EVT_SET(LVar0, MODEL_hako2) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_WAIT(4) + EVT_SET(LVar0, MODEL_hako4) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_WAIT(4) + EVT_SET(LVar0, MODEL_hako5) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_WAIT(4) + EVT_SET(LVar0, MODEL_hako6) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_END_THREAD + EVT_SET(LVar0, MODEL_fune2) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_SET(LVar0, MODEL_fune1) + EVT_EXEC(N(EVS_AnimateFlotsam)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_hone, + MODEL_hako4, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kgr_tex", + .shape = "kgr_bt01_shape", + .hit = "kgr_bt01_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/area/kpa2/stage/kpa_02.c b/src/battle/common/stage/area_kkj/kkj_01.inc.c similarity index 91% rename from src/battle/area/kpa2/stage/kpa_02.c rename to src/battle/common/stage/area_kkj/kkj_01.inc.c index 73645e7af4..e9fe6a019c 100644 --- a/src/battle/area/kpa2/stage/kpa_02.c +++ b/src/battle/common/stage/area_kkj/kkj_01.inc.c @@ -1,8 +1,7 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/kkj_bt01_shape.h" -#define NAMESPACE b_area_kpa2_kpa_02 +#define NAMESPACE A(kkj_01) EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) diff --git a/src/battle/common/stage/kkj_02.inc.c b/src/battle/common/stage/area_kkj/kkj_02.inc.c similarity index 98% rename from src/battle/common/stage/kkj_02.inc.c rename to src/battle/common/stage/area_kkj/kkj_02.inc.c index bb723d2177..09e028c415 100644 --- a/src/battle/common/stage/kkj_02.inc.c +++ b/src/battle/common/stage/area_kkj/kkj_02.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/kkj_bt02_shape.h" +#define NAMESPACE A(kkj_02) + #include "world/common/util/SetLightningBoltPurple.inc.c" s32 N(RandomBoltPositions)[][7] = { diff --git a/src/battle/common/stage/kmr_02.inc.c b/src/battle/common/stage/area_kmr/kmr_02.inc.c similarity index 93% rename from src/battle/common/stage/kmr_02.inc.c rename to src/battle/common/stage/area_kmr/kmr_02.inc.c index e1a39298d1..7caf79fcda 100644 --- a/src/battle/common/stage/kmr_02.inc.c +++ b/src/battle/common/stage/area_kmr/kmr_02.inc.c @@ -1,6 +1,7 @@ -#include "common.h" #include "battle/battle.h" +#define NAMESPACE A(kmr_02) + EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) EVT_RETURN diff --git a/src/battle/common/stage/kmr_03.inc.c b/src/battle/common/stage/area_kmr/kmr_03.inc.c similarity index 89% rename from src/battle/common/stage/kmr_03.inc.c rename to src/battle/common/stage/area_kmr/kmr_03.inc.c index b96e3190d8..fc5b74399f 100644 --- a/src/battle/common/stage/kmr_03.inc.c +++ b/src/battle/common/stage/area_kmr/kmr_03.inc.c @@ -1,15 +1,16 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/kmr_bt03_shape.h" +#define NAMESPACE A(kmr_03) + #include "battle/common/stage/lib/MovingClouds.inc.c" EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_SET(LVar0, 1) + EVT_SET(LVar0, MODEL_g59) EVT_SET(LVar2, 0) EVT_EXEC(N(EVS_AnimateCloud)) - EVT_SET(LVar0, 4) + EVT_SET(LVar0, MODEL_g60) EVT_SET(LVar2, 70) EVT_EXEC(N(EVS_AnimateCloud)) EVT_RETURN diff --git a/src/battle/common/stage/kmr_04.inc.c b/src/battle/common/stage/area_kmr/kmr_04.inc.c similarity index 89% rename from src/battle/common/stage/kmr_04.inc.c rename to src/battle/common/stage/area_kmr/kmr_04.inc.c index fc221b1f6b..029cb0941d 100644 --- a/src/battle/common/stage/kmr_04.inc.c +++ b/src/battle/common/stage/area_kmr/kmr_04.inc.c @@ -1,15 +1,16 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/kmr_bt04_shape.h" +#define NAMESPACE A(kmr_04) + #include "battle/common/stage/lib/MovingClouds.inc.c" EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_SET(LVar0, 1) + EVT_SET(LVar0, MODEL_g60) EVT_SET(LVar2, 0) EVT_EXEC(N(EVS_AnimateCloud)) - EVT_SET(LVar0, 4) + EVT_SET(LVar0, MODEL_g61) EVT_SET(LVar2, 70) EVT_EXEC(N(EVS_AnimateCloud)) EVT_RETURN diff --git a/src/battle/common/stage/kmr_05.inc.c b/src/battle/common/stage/area_kmr/kmr_05.inc.c similarity index 95% rename from src/battle/common/stage/kmr_05.inc.c rename to src/battle/common/stage/area_kmr/kmr_05.inc.c index a868003bd2..b69b20b662 100644 --- a/src/battle/common/stage/kmr_05.inc.c +++ b/src/battle/common/stage/area_kmr/kmr_05.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/kmr_bt05_shape.h" +#define NAMESPACE A(kmr_05) + #include "battle/common/stage/lib/MovingClouds.inc.c" EvtScript N(EVS_PreBattle) = { diff --git a/src/battle/area/kmr_part_3/stage/kmr_05.c b/src/battle/common/stage/area_kmr/kmr_05b.inc.c similarity index 91% rename from src/battle/area/kmr_part_3/stage/kmr_05.c rename to src/battle/common/stage/area_kmr/kmr_05b.inc.c index d42592816c..a770dfce02 100644 --- a/src/battle/area/kmr_part_3/stage/kmr_05.c +++ b/src/battle/common/stage/area_kmr/kmr_05b.inc.c @@ -1,8 +1,7 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/kmr_bt05_shape.h" -#define NAMESPACE b_area_kmr_part_3_kmr_05 +#define NAMESPACE A(kmr_05b) #include "battle/common/stage/lib/MovingClouds.inc.c" diff --git a/src/battle/common/stage/kmr_06.inc.c b/src/battle/common/stage/area_kmr/kmr_06.inc.c similarity index 73% rename from src/battle/common/stage/kmr_06.inc.c rename to src/battle/common/stage/area_kmr/kmr_06.inc.c index f37037f3e5..e6704a7be6 100644 --- a/src/battle/common/stage/kmr_06.inc.c +++ b/src/battle/common/stage/area_kmr/kmr_06.inc.c @@ -1,17 +1,24 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/kmr_bt06_shape.h" +#define NAMESPACE A(kmr_06) + #include "battle/common/stage/lib/MovingClouds.inc.c" -#include "common/UnkFogFunc.inc.c" + +API_CALLABLE(N(SetupFog)) { + set_world_fog_dist(980, 1000); + set_world_fog_color(15, 5, 55, 255); + enable_world_fog(); + return ApiStatus_DONE2; +} EvtScript N(EVS_PreBattle) = { EVT_CALL(SetSpriteShading, SHADING_NONE) - EVT_CALL(N(UnkFogFunc)) - EVT_SET(LVar0, 1) + EVT_CALL(N(SetupFog)) + EVT_SET(LVar0, MODEL_g59) EVT_SET(LVar2, 0) EVT_EXEC(N(EVS_AnimateCloud)) - EVT_SET(LVar0, 4) + EVT_SET(LVar0, MODEL_g60) EVT_SET(LVar2, 70) EVT_EXEC(N(EVS_AnimateCloud)) EVT_RETURN diff --git a/src/battle/common/stage/area_kpa/kpa_01.inc.c b/src/battle/common/stage/area_kpa/kpa_01.inc.c new file mode 100644 index 0000000000..b26a96d52e --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_01.inc.c @@ -0,0 +1,56 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt01_shape.h" + +#define NAMESPACE A(kpa_01) + +// blue torches +EvtScript N(EVS_TexAnim_Fire) = { + EVT_SET(LVarA, LVar0) + EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_LOOP(0) + EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) + EVT_ADD(LVar0, 0x8000) + EVT_ADD(LVar1, 0) + EVT_WAIT(5) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_switch, MODEL_GROUP_HIDDEN) + EVT_THREAD + EVT_SET(LVar0, MODEL_o416) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_o418) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_END_THREAD + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o383, + MODEL_o382, + MODEL_o381, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt01_shape", + .hit = "kpa_bt01_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_01b.inc.c b/src/battle/common/stage/area_kpa/kpa_01b.inc.c new file mode 100644 index 0000000000..536a195434 --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_01b.inc.c @@ -0,0 +1,53 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt01_shape.h" + +#define NAMESPACE A(kpa_01b) + +// blue torches +EvtScript N(EVS_TexAnim_Fire) = { + EVT_SET(LVarA, LVar0) + EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_LOOP(0) + EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) + EVT_ADD(LVar0, 0x8000) + EVT_ADD(LVar1, 0) + EVT_WAIT(5) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_hasira, MODEL_GROUP_HIDDEN) + EVT_SET(LVar0, MODEL_o416) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_SET(LVar0, MODEL_o418) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o383, + MODEL_o382, + MODEL_o381, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt01_shape", + .hit = "kpa_bt01_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_02.inc.c b/src/battle/common/stage/area_kpa/kpa_02.inc.c new file mode 100644 index 0000000000..c954eda1e6 --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_02.inc.c @@ -0,0 +1,52 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt02_shape.h" + +#define NAMESPACE A(kpa_02) + +#include "battle/common/stage/lib/TexturePanner.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_SET(LVar0, MODEL_2) + EVT_SET(LVar1, TEX_PANNER_1) + EVT_SET(LVar2, -400) + EVT_SET(LVar3, -800) + EVT_EXEC(N(EVS_TexturePanBothU)) + EVT_SET(LVar0, MODEL_4) + EVT_SET(LVar1, TEX_PANNER_3) + EVT_SET(LVar2, -400) + EVT_SET(LVar3, -800) + EVT_EXEC(N(EVS_TexturePanBothU)) + EVT_SET(LVar0, MODEL_1) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_SET(LVar2, -400) + EVT_SET(LVar3, -800) + EVT_EXEC(N(EVS_TexturePanBothV)) + EVT_SET(LVar0, MODEL_3) + EVT_SET(LVar1, TEX_PANNER_2) + EVT_SET(LVar2, -400) + EVT_SET(LVar3, -800) + EVT_EXEC(N(EVS_TexturePanBothV)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_saku, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt02_shape", + .hit = "kpa_bt02_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_03.inc.c b/src/battle/common/stage/area_kpa/kpa_03.inc.c new file mode 100644 index 0000000000..bbf806119d --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_03.inc.c @@ -0,0 +1,32 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/kpa_bt03_shape.h" + +#define NAMESPACE A(kpa_03) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetDarknessMode, BTL_DARKNESS_MODE_1) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_tar1, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt03_shape", + .hit = "kpa_bt03_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_04.inc.c b/src/battle/common/stage/area_kpa/kpa_04.inc.c new file mode 100644 index 0000000000..08cc2086c4 --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_04.inc.c @@ -0,0 +1,54 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt04_shape.h" + +#define NAMESPACE A(kpa_04) + +// blue torches +EvtScript N(EVS_TexAnim_Fire) = { + EVT_SET(LVarA, LVar0) + EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_LOOP(0) + EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) + EVT_ADD(LVar0, 0x8000) + EVT_ADD(LVar1, 0) + EVT_WAIT(5) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_g3, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_wa, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_kusari, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_g4, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_hi1, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_hi2, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_hi3, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_hi4, MODEL_GROUP_HIDDEN) + EVT_SET(LVar0, MODEL_o450) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_SET(LVar0, MODEL_o451) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_SET(LVar0, MODEL_o454) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt04_shape", + .hit = "kpa_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_04b.inc.c b/src/battle/common/stage/area_kpa/kpa_04b.inc.c new file mode 100644 index 0000000000..53291a7fc4 --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_04b.inc.c @@ -0,0 +1,53 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt04_shape.h" + +#define NAMESPACE A(kpa_04b) + +// blue torches +EvtScript N(EVS_TexAnim_Fire) = { + EVT_SET(LVarA, LVar0) + EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_LOOP(0) + EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) + EVT_ADD(LVar0, 0x8000) + EVT_ADD(LVar1, 0) + EVT_WAIT(5) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_g2, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_wa, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_kusari, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_hi1, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_hi2, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_hi3, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_hi4, MODEL_GROUP_HIDDEN) + EVT_SET(LVar0, MODEL_o450) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_SET(LVar0, MODEL_o451) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_SET(LVar0, MODEL_o454) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt04_shape", + .hit = "kpa_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_04c.inc.c b/src/battle/common/stage/area_kpa/kpa_04c.inc.c new file mode 100644 index 0000000000..365099fe7b --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_04c.inc.c @@ -0,0 +1,54 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt04_shape.h" + +#define NAMESPACE A(kpa_04c) + +// blue torches +EvtScript N(EVS_TexAnim_Fire) = { + EVT_SET(LVarA, LVar0) + EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_LOOP(0) + EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) + EVT_ADD(LVar0, 0x8000) + EVT_ADD(LVar1, 0) + EVT_WAIT(5) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_o415, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_o453, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_o452, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_o454, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_o451, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_o450, MODEL_GROUP_HIDDEN) + EVT_SET(LVar0, MODEL_hi1) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_SET(LVar0, MODEL_hi2) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_SET(LVar0, MODEL_hi3) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_SET(LVar0, MODEL_hi4) + EVT_EXEC(N(EVS_TexAnim_Fire)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt04_shape", + .hit = "kpa_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_05.inc.c b/src/battle/common/stage/area_kpa/kpa_05.inc.c new file mode 100644 index 0000000000..5ba65ec90a --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_05.inc.c @@ -0,0 +1,30 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt05_shape.h" + +#define NAMESPACE A(kpa_05) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_saku, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt05_shape", + .hit = "kpa_bt05_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_07.inc.c b/src/battle/common/stage/area_kpa/kpa_07.inc.c new file mode 100644 index 0000000000..e6e53e99e0 --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_07.inc.c @@ -0,0 +1,47 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt07_shape.h" + +#define NAMESPACE A(kpa_07) + +#include "battle/common/stage/lib/TexturePanner.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_SET(LVar0, MODEL_kemu2) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_SET(LVar2, -200) + EVT_SET(LVar3, 0) + EVT_EXEC(N(EVS_TexturePanMain)) + EVT_SET(LVar0, MODEL_kemu1) + EVT_SET(LVar1, TEX_PANNER_1) + EVT_SET(LVar2, -120) + EVT_SET(LVar3, 0) + EVT_EXEC(N(EVS_TexturePanMain)) + EVT_SET(LVar0, MODEL_kemu3) + EVT_SET(LVar1, TEX_PANNER_2) + EVT_SET(LVar2, -100) + EVT_SET(LVar3, 0) + EVT_EXEC(N(EVS_TexturePanMain)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_kemu1, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt07_shape", + .hit = "kpa_bt07_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_08.inc.c b/src/battle/common/stage/area_kpa/kpa_08.inc.c new file mode 100644 index 0000000000..301c3bbd76 --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_08.inc.c @@ -0,0 +1,30 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt08_shape.h" + +#define NAMESPACE A(kpa_08) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o478, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt08_shape", + .hit = "kpa_bt08_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_09.inc.c b/src/battle/common/stage/area_kpa/kpa_09.inc.c new file mode 100644 index 0000000000..887ddb774e --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_09.inc.c @@ -0,0 +1,30 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt09_shape.h" + +#define NAMESPACE A(kpa_09) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o353, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt09_shape", + .hit = "kpa_bt09_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kpa/kpa_11.inc.c b/src/battle/common/stage/area_kpa/kpa_11.inc.c new file mode 100644 index 0000000000..ab4fb9a66d --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_11.inc.c @@ -0,0 +1,30 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt11_shape.h" + +#define NAMESPACE A(kpa_11) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_h2, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt11_shape", + .hit = "kpa_bt11_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/area/kmr_part_3/stage/kpa_01.c b/src/battle/common/stage/area_kpa/kpa_13.inc.c similarity index 89% rename from src/battle/area/kmr_part_3/stage/kpa_01.c rename to src/battle/common/stage/area_kpa/kpa_13.inc.c index da303b8519..503f881ff3 100644 --- a/src/battle/area/kmr_part_3/stage/kpa_01.c +++ b/src/battle/common/stage/area_kpa/kpa_13.inc.c @@ -1,10 +1,10 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/kpa_bt13_shape.h" -#define NAMESPACE b_area_kmr_part_3_kpa_01 +#define NAMESPACE A(kpa_13) -EvtScript N(EVS_TexPan_Unused) = { +// blue torches +EvtScript N(EVS_TexAnim_Fire) = { EVT_SET(LVarA, LVar0) EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) EVT_SET(LVar0, 0) diff --git a/src/battle/common/stage/area_kpa/kpa_14.inc.c b/src/battle/common/stage/area_kpa/kpa_14.inc.c new file mode 100644 index 0000000000..cdea944402 --- /dev/null +++ b/src/battle/common/stage/area_kpa/kpa_14.inc.c @@ -0,0 +1,40 @@ +#include "battle/battle.h" +#include "mapfs/kpa_bt14_shape.h" + +#define NAMESPACE A(kpa_14) + +// blue torches +EvtScript N(EVS_TexAnim_Fire) = { + EVT_SET(LVarA, LVar0) + EVT_CALL(SetTexPanner, LVarA, TEX_PANNER_1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_LOOP(0) + EVT_CALL(SetTexPanOffset, TEX_PANNER_1, TEX_PANNER_MAIN, LVar0, LVar1) + EVT_ADD(LVar0, 0x8000) + EVT_ADD(LVar1, 0) + EVT_WAIT(5) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "kpa_tex", + .shape = "kpa_bt14_shape", + .hit = "kpa_bt14_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_kzn/Decorations.inc.c b/src/battle/common/stage/area_kzn/Decorations.inc.c new file mode 100644 index 0000000000..9be52c875b --- /dev/null +++ b/src/battle/common/stage/area_kzn/Decorations.inc.c @@ -0,0 +1,65 @@ +#include "battle/battle.h" + +EvtScript N(EVS_TexPan_Lava) = { + EVT_SET(LVarA, LVar1) + EVT_CALL(SetTexPanner, LVar0, LVar1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_LOOP(0) + EVT_CALL(SetTexPanOffset, LVarA, TEX_PANNER_MAIN, LVar0, 0) + EVT_CALL(SetTexPanOffset, LVarA, TEX_PANNER_AUX, LVar1, 0) + EVT_SUB(LVar0, -300) + EVT_SUB(LVar1, -500) + EVT_WAIT(1) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_TexAnim_LavaBubble) = { + EVT_SET(LVarA, LVar1) + EVT_CALL(SetTexPanner, LVar0, LVar1) + EVT_SET(LVar0, 0) + EVT_SET(LVar1, 0) + EVT_LOOP(0) + EVT_CALL(SetTexPanOffset, LVarA, TEX_PANNER_MAIN, LVar0, LVar1) + EVT_ADD(LVar0, 0x4000) + EVT_ADD(LVar1, 0) + EVT_WAIT(5) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_MovingPlatform) = { + EVT_SET(LVarA, LVar0) // modelID + EVT_SET(LVar9, LVar1) // start X + EVT_SET(LVar8, LVar2) // end X + EVT_SET(LVar7, LVar3) // move time + EVT_LABEL(0) + EVT_SET(LVar2, LVar8) + EVT_ADD(LVar2, LVar9) + EVT_CALL(MakeLerp, LVar8, LVar2, LVar7, EASING_LINEAR) + EVT_LOOP(0) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 0) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_SET(LVar2, LVar8) + EVT_ADD(LVar2, LVar9) + EVT_CALL(MakeLerp, LVar2, LVar8, LVar7, EASING_LINEAR) + EVT_LOOP(0) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateGroup, LVarA, LVar0, 0, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 0) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; diff --git a/src/battle/common/stage/area_kzn/kzn_01.inc.c b/src/battle/common/stage/area_kzn/kzn_01.inc.c new file mode 100644 index 0000000000..b9b1ff65e0 --- /dev/null +++ b/src/battle/common/stage/area_kzn/kzn_01.inc.c @@ -0,0 +1,35 @@ +#include "battle/battle.h" +#include "mapfs/kzn_bt01_shape.h" + +#define NAMESPACE A(kzn_01) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_o363, MODEL_GROUP_HIDDEN) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_ue2, + MODEL_ue1, + MODEL_iwa3, + MODEL_sita1, + MODEL_ue3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kzn_tex", + .shape = "kzn_bt01_shape", + .hit = "kzn_bt01_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kzn/kzn_01b.inc.c b/src/battle/common/stage/area_kzn/kzn_01b.inc.c new file mode 100644 index 0000000000..6b4c8c5ee8 --- /dev/null +++ b/src/battle/common/stage/area_kzn/kzn_01b.inc.c @@ -0,0 +1,34 @@ +#include "battle/battle.h" +#include "mapfs/kzn_bt01_shape.h" + +#define NAMESPACE A(kzn_01b) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_ue2, + MODEL_ue1, + MODEL_iwa3, + MODEL_sita1, + MODEL_ue3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kzn_tex", + .shape = "kzn_bt01_shape", + .hit = "kzn_bt01_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kzn/kzn_02.inc.c b/src/battle/common/stage/area_kzn/kzn_02.inc.c new file mode 100644 index 0000000000..688a77fa01 --- /dev/null +++ b/src/battle/common/stage/area_kzn/kzn_02.inc.c @@ -0,0 +1,60 @@ +#include "battle/battle.h" +#include "mapfs/kzn_bt02_shape.h" + +#define NAMESPACE A(kzn_02) + +#include "./Decorations.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_SET(LVar0, MODEL_yougan) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y1_1) + EVT_SET(LVar1, TEX_PANNER_1) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y1_2) + EVT_SET(LVar1, TEX_PANNER_2) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y2_1) + EVT_SET(LVar1, TEX_PANNER_3) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y2_2) + EVT_SET(LVar1, TEX_PANNER_4) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y3_1) + EVT_SET(LVar1, TEX_PANNER_5) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y3_2) + EVT_SET(LVar1, TEX_PANNER_6) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_move) + EVT_SET(LVar1, 180) + EVT_SET(LVar2, 0) + EVT_SET(LVar3, 200) + EVT_EXEC(N(EVS_MovingPlatform)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_iwa3, + MODEL_sita1, + MODEL_ue3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kzn_tex", + .shape = "kzn_bt02_shape", + .hit = "kzn_bt02_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kzn/kzn_04.inc.c b/src/battle/common/stage/area_kzn/kzn_04.inc.c new file mode 100644 index 0000000000..7f209ecc94 --- /dev/null +++ b/src/battle/common/stage/area_kzn/kzn_04.inc.c @@ -0,0 +1,66 @@ +#include "battle/battle.h" +#include "mapfs/kzn_bt04_shape.h" + +#define NAMESPACE A(kzn_04) + +#include "./Decorations.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_08, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_16, MODEL_GROUP_HIDDEN) + EVT_SET(LVar0, MODEL_y2_1) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y2_2) + EVT_SET(LVar1, TEX_PANNER_1) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y3_1) + EVT_SET(LVar1, TEX_PANNER_2) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y3_2) + EVT_SET(LVar1, TEX_PANNER_3) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_yougan) + EVT_SET(LVar1, TEX_PANNER_4) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_6_you1) + EVT_SET(LVar1, TEX_PANNER_5) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_6_you2) + EVT_SET(LVar1, TEX_PANNER_6) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_tri) + EVT_SET(LVar1, TEX_PANNER_7) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_awa1) + EVT_SET(LVar1, TEX_PANNER_8) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_SET(LVar0, MODEL_awa2) + EVT_SET(LVar1, TEX_PANNER_9) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_iwa3, + MODEL_sita1, + MODEL_ue3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kzn_tex", + .shape = "kzn_bt04_shape", + .hit = "kzn_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kzn/kzn_04b.inc.c b/src/battle/common/stage/area_kzn/kzn_04b.inc.c new file mode 100644 index 0000000000..8777976ae9 --- /dev/null +++ b/src/battle/common/stage/area_kzn/kzn_04b.inc.c @@ -0,0 +1,66 @@ +#include "battle/battle.h" +#include "mapfs/kzn_bt04_shape.h" + +#define NAMESPACE A(kzn_04b) + +#include "./Decorations.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_06, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_16, MODEL_GROUP_HIDDEN) + EVT_SET(LVar0, MODEL_y2_1) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y2_2) + EVT_SET(LVar1, TEX_PANNER_1) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y3_1) + EVT_SET(LVar1, TEX_PANNER_2) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y3_2) + EVT_SET(LVar1, TEX_PANNER_3) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_yougan) + EVT_SET(LVar1, TEX_PANNER_4) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y1_1) + EVT_SET(LVar1, TEX_PANNER_5) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y1_2) + EVT_SET(LVar1, TEX_PANNER_6) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_tri) + EVT_SET(LVar1, TEX_PANNER_7) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_awa1) + EVT_SET(LVar1, TEX_PANNER_8) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_SET(LVar0, MODEL_awa2) + EVT_SET(LVar1, TEX_PANNER_9) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_iwa3, + MODEL_sita1, + MODEL_ue3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kzn_tex", + .shape = "kzn_bt04_shape", + .hit = "kzn_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kzn/kzn_04c.inc.c b/src/battle/common/stage/area_kzn/kzn_04c.inc.c new file mode 100644 index 0000000000..74d287da9d --- /dev/null +++ b/src/battle/common/stage/area_kzn/kzn_04c.inc.c @@ -0,0 +1,60 @@ +#include "battle/battle.h" +#include "mapfs/kzn_bt04_shape.h" + +#define NAMESPACE A(kzn_04c) + +#include "./Decorations.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_06, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_08, MODEL_GROUP_HIDDEN) + EVT_SET(LVar0, MODEL_y2_1) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y2_2) + EVT_SET(LVar1, TEX_PANNER_1) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y3_1) + EVT_SET(LVar1, TEX_PANNER_2) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_y3_2) + EVT_SET(LVar1, TEX_PANNER_3) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_yougan) + EVT_SET(LVar1, TEX_PANNER_4) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_tri) + EVT_SET(LVar1, TEX_PANNER_7) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_awa1) + EVT_SET(LVar1, TEX_PANNER_8) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_SET(LVar0, MODEL_awa2) + EVT_SET(LVar1, TEX_PANNER_9) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_iwa3, + MODEL_sita1, + MODEL_ue3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "kzn_tex", + .shape = "kzn_bt04_shape", + .hit = "kzn_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_kzn/kzn_05.inc.c b/src/battle/common/stage/area_kzn/kzn_05.inc.c new file mode 100644 index 0000000000..baa2272d4d --- /dev/null +++ b/src/battle/common/stage/area_kzn/kzn_05.inc.c @@ -0,0 +1,103 @@ +#include "battle/battle.h" +#include "mapfs/kzn_bt05_shape.h" + +#define NAMESPACE A(kzn_05) + +#include "./Decorations.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_SET(LVar0, MODEL_yougan2) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_yougan) + EVT_SET(LVar1, TEX_PANNER_1) + EVT_EXEC(N(EVS_TexPan_Lava)) + EVT_SET(LVar0, MODEL_awa1) + EVT_SET(LVar1, TEX_PANNER_2) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_SET(LVar0, MODEL_awa2) + EVT_SET(LVar1, TEX_PANNER_3) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_SET(LVar0, MODEL_awa3) + EVT_SET(LVar1, TEX_PANNER_4) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_SET(LVar0, MODEL_awa4) + EVT_SET(LVar1, TEX_PANNER_5) + EVT_EXEC(N(EVS_TexAnim_LavaBubble)) + EVT_CALL(EnableModel, MODEL_p00, FALSE) + EVT_CALL(EnableModel, MODEL_p01, FALSE) + EVT_CALL(EnableModel, MODEL_p02, FALSE) + EVT_CALL(EnableModel, MODEL_p03, FALSE) + EVT_CALL(EnableModel, MODEL_p04, FALSE) + EVT_CALL(EnableModel, MODEL_p05, FALSE) + EVT_CALL(EnableModel, MODEL_p06, FALSE) + EVT_CALL(EnableModel, MODEL_p07, FALSE) + EVT_CALL(EnableModel, MODEL_p08, FALSE) + EVT_CALL(EnableModel, MODEL_p09, FALSE) + EVT_CALL(EnableModel, MODEL_p10, FALSE) + EVT_CALL(EnableModel, MODEL_p11, FALSE) + EVT_CALL(EnableModel, MODEL_p12, FALSE) + EVT_CALL(EnableModel, MODEL_q00, FALSE) + EVT_CALL(EnableModel, MODEL_q01, FALSE) + EVT_CALL(EnableModel, MODEL_q02, FALSE) + EVT_CALL(EnableModel, MODEL_q03, FALSE) + EVT_CALL(EnableModel, MODEL_q04, FALSE) + EVT_CALL(EnableModel, MODEL_q05, FALSE) + EVT_CALL(EnableModel, MODEL_q06, FALSE) + EVT_CALL(EnableModel, MODEL_q07, FALSE) + EVT_CALL(EnableModel, MODEL_q08, FALSE) + EVT_CALL(EnableModel, MODEL_q09, FALSE) + EVT_CALL(EnableModel, MODEL_q10, FALSE) + EVT_CALL(EnableModel, MODEL_q11, FALSE) + EVT_CALL(EnableModel, MODEL_q12, FALSE) + EVT_CALL(EnableModel, MODEL_r00, FALSE) + EVT_CALL(EnableModel, MODEL_r01, FALSE) + EVT_CALL(EnableModel, MODEL_r02, FALSE) + EVT_CALL(EnableModel, MODEL_r03, FALSE) + EVT_CALL(EnableModel, MODEL_r04, FALSE) + EVT_CALL(EnableModel, MODEL_r05, FALSE) + EVT_CALL(EnableModel, MODEL_r06, FALSE) + EVT_CALL(EnableModel, MODEL_r07, FALSE) + EVT_CALL(EnableModel, MODEL_r08, FALSE) + EVT_CALL(EnableModel, MODEL_r09, FALSE) + EVT_CALL(EnableModel, MODEL_r10, FALSE) + EVT_CALL(EnableModel, MODEL_r11, FALSE) + EVT_CALL(EnableModel, MODEL_r12, FALSE) + EVT_CALL(EnableModel, MODEL_s01, FALSE) + EVT_CALL(EnableModel, MODEL_s02, FALSE) + EVT_CALL(EnableModel, MODEL_s03, FALSE) + EVT_CALL(EnableModel, MODEL_s04, FALSE) + EVT_CALL(EnableModel, MODEL_s05, FALSE) + EVT_CALL(EnableModel, MODEL_s06, FALSE) + EVT_CALL(EnableModel, MODEL_s07, FALSE) + EVT_CALL(EnableModel, MODEL_s08, FALSE) + EVT_CALL(EnableModel, MODEL_s09, FALSE) + EVT_CALL(EnableModel, MODEL_h01, FALSE) + EVT_CALL(EnableModel, MODEL_h02, FALSE) + EVT_CALL(EnableModel, MODEL_h03, FALSE) + EVT_CALL(EnableModel, MODEL_h04, FALSE) + EVT_CALL(EnableModel, MODEL_h05, FALSE) + EVT_CALL(EnableModel, MODEL_h06, FALSE) + EVT_CALL(EnableModel, MODEL_h07, FALSE) + EVT_CALL(EnableModel, MODEL_h08, FALSE) + EVT_CALL(EnableModel, MODEL_h09, FALSE) + EVT_CALL(EnableModel, MODEL_h10, FALSE) + EVT_CALL(EnableModel, MODEL_h11, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "kzn_tex", + .shape = "kzn_bt05_shape", + .hit = "kzn_bt05_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_mac/mac_01.inc.c b/src/battle/common/stage/area_mac/mac_01.inc.c new file mode 100644 index 0000000000..7a0f71af8b --- /dev/null +++ b/src/battle/common/stage/area_mac/mac_01.inc.c @@ -0,0 +1,42 @@ +#include "battle/battle.h" +#include "mapfs/mac_bt01_shape.h" + +#define NAMESPACE A(mac_01) + +#include "battle/common/stage/lib/WaterEffects.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_THREAD + EVT_SET(LVar0, MODEL_nami4) + EVT_EXEC(N(EVS_AnimateWaveModel)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_nami3) + EVT_EXEC(N(EVS_AnimateWaveModel)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_nami2) + EVT_EXEC(N(EVS_AnimateWaveModel)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_nami1) + EVT_EXEC(N(EVS_AnimateWaveModel)) + EVT_END_THREAD + EVT_SET(LVar0, MODEL_o391) + EVT_EXEC(N(EVS_AnimateFishModel)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "mac_tex", + .shape = "mac_bt01_shape", + .hit = "mac_bt01_hit", + .bg = "nok_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_mac/mac_02.inc.c b/src/battle/common/stage/area_mac/mac_02.inc.c new file mode 100644 index 0000000000..04bb4a1f25 --- /dev/null +++ b/src/battle/common/stage/area_mac/mac_02.inc.c @@ -0,0 +1,27 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/mac_bt02_shape.h" + +#define NAMESPACE A(mac_02) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(EnableBattleFloorReflections, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_CALL(EnableBattleFloorReflections, FALSE) + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "mac_tex", + .shape = "mac_bt02_shape", + .hit = "mac_bt02_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_mim/mim_01.inc.c b/src/battle/common/stage/area_mim/mim_01.inc.c new file mode 100644 index 0000000000..2341e43944 --- /dev/null +++ b/src/battle/common/stage/area_mim/mim_01.inc.c @@ -0,0 +1,35 @@ +#include "battle/battle.h" +#include "mapfs/mim_bt01_shape.h" + +#define NAMESPACE A(mim_01) + +API_CALLABLE(N(SetupFog)) { + enable_world_fog(); + set_world_fog_dist(950, 1000); + set_world_fog_color(16, 16, 16, 255); + gCameras[CAM_BATTLE].bgColor[0] = 20; + gCameras[CAM_BATTLE].bgColor[1] = 20; + gCameras[CAM_BATTLE].bgColor[2] = 28; + + return ApiStatus_DONE2; +} + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(N(SetupFog)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "mim_tex", + .shape = "mim_bt01_shape", + .hit = "mim_bt01_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/nok_01.inc.c b/src/battle/common/stage/area_nok/nok_01.inc.c similarity index 98% rename from src/battle/common/stage/nok_01.inc.c rename to src/battle/common/stage/area_nok/nok_01.inc.c index 30fe0f84b0..04eae6a190 100644 --- a/src/battle/common/stage/nok_01.inc.c +++ b/src/battle/common/stage/area_nok/nok_01.inc.c @@ -1,7 +1,8 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/nok_bt01_shape.h" +#define NAMESPACE A(nok_01) + EvtScript N(EVS_AnimateFlower) = { EVT_SET(LVarA, LVar0) EVT_LABEL(0) diff --git a/src/battle/common/stage/area_nok/nok_02.inc.c b/src/battle/common/stage/area_nok/nok_02.inc.c new file mode 100644 index 0000000000..f277a0f8f0 --- /dev/null +++ b/src/battle/common/stage/area_nok/nok_02.inc.c @@ -0,0 +1,82 @@ +#include "battle/battle.h" +#include "mapfs/nok_bt02_shape.h" + +#define NAMESPACE A(nok_02) + +EvtScript N(EVS_AnimateFlower) = { + EVT_SET(LVarA, LVar0) + EVT_LABEL(0) + EVT_CALL(TranslateModel, LVarA, 0, 2, 0) + EVT_WAIT(5) + EVT_CALL(TranslateModel, LVarA, 0, 0, 0) + EVT_WAIT(5) + EVT_CALL(TranslateModel, LVarA, 0, 2, 0) + EVT_WAIT(5) + EVT_CALL(TranslateModel, LVarA, 0, 0, 0) + EVT_WAIT(5) + EVT_CALL(RandInt, 30, LVar0) + EVT_ADD(LVar0, 30) + EVT_WAIT(LVar0) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_THREAD + EVT_SET(LVar0, MODEL_h1) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h3) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h4) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h5) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h6) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h7) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h9) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h10) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h11) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_h12) + EVT_EXEC(N(EVS_AnimateFlower)) + EVT_END_THREAD + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_ha3, + MODEL_hap, + MODEL_kusa3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "nok_tex", + .shape = "nok_bt02_shape", + .hit = "nok_bt02_hit", + .bg = "nok_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_nok/nok_03.inc.c b/src/battle/common/stage/area_nok/nok_03.inc.c new file mode 100644 index 0000000000..530b6773a6 --- /dev/null +++ b/src/battle/common/stage/area_nok/nok_03.inc.c @@ -0,0 +1,31 @@ +#include "battle/battle.h" +#include "mapfs/nok_bt03_shape.h" + +#define NAMESPACE A(nok_03) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_ha3, + MODEL_hap, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "nok_tex", + .shape = "nok_bt03_shape", + .hit = "nok_bt03_hit", + .bg = "nok_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_nok/nok_04.inc.c b/src/battle/common/stage/area_nok/nok_04.inc.c new file mode 100644 index 0000000000..0f7d241b40 --- /dev/null +++ b/src/battle/common/stage/area_nok/nok_04.inc.c @@ -0,0 +1,34 @@ +#include "battle/battle.h" +#include "mapfs/nok_bt04_shape.h" + +#define NAMESPACE A(nok_04) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_ueki2, + MODEL_ueki1, + MODEL_kabu2, + MODEL_kabu1, + MODEL_kusa3, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "nok_tex", + .shape = "nok_bt04_shape", + .hit = "nok_bt04_hit", + .bg = "nok_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_omo/omo_01.inc.c b/src/battle/common/stage/area_omo/omo_01.inc.c new file mode 100644 index 0000000000..1593449703 --- /dev/null +++ b/src/battle/common/stage/area_omo/omo_01.inc.c @@ -0,0 +1,105 @@ +#include "battle/battle.h" +#include "mapfs/omo_bt01_shape.h" +#include "model.h" + +#define NAMESPACE A(omo_01) + +// following part is very similar to RockingHorse.inc.c in world/area_omo, +// but it does not match it exactly + +extern EvtScript N(EVS_UpdateRockingHorse); + +s32 N(RockingHorseModels)[] = { MODEL_uma }; + +typedef struct RockingHorse { + /* 0x00 */ f32 offsetX; + /* 0x04 */ f32 offsetZ; + /* 0x08 */ f32 rockPhaseAngularVel; + /* 0x0C */ f32 rockPhase; + /* 0x10 */ s32 modelID; + /* 0x14 */ s32 unk_14; +} RockingHorse; // size = 0x18 + +API_CALLABLE(N(UpdateRockingHorse)) { + RockingHorse* horse; + Model* model; + f32 rotZ; + f32 offsetY; + s32 i; + Matrix4f mtxPivot; + Matrix4f mtxRotate; + + if (isInitialCall) { + horse = heap_malloc(sizeof(*horse)); + script->functionTempPtr[0] = horse; + + for (i = 0; i == 0; i++, horse++) { + horse->modelID = N(RockingHorseModels)[i]; + horse->unk_14 = ((s32*)N(EVS_UpdateRockingHorse))[i]; // WTF ??? + model = get_model_from_list_index(get_model_list_index_from_tree_index(horse->modelID)); + horse->offsetX = 0.0f; + horse->offsetZ = 0.0f; + horse->rockPhaseAngularVel = 3.5f; + horse->rockPhase = 0.0f; + } + } + + horse = script->functionTempPtr[0]; + for (i = 0; i == 0; i++, horse++) { + horse->rockPhase += horse->rockPhaseAngularVel; + horse->rockPhase = clamp_angle(horse->rockPhase); + + rotZ = sin_rad(horse->rockPhase * 3.14f / 180.0f) * 20.0f; + offsetY = SQ(rotZ) / 90.0f; + + model = get_model_from_list_index(get_model_list_index_from_tree_index(horse->modelID)); + model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED; + guTranslateF(mtxPivot, -horse->offsetX, 0.0f, -horse->offsetZ); + guRotateF(mtxRotate, rotZ, 0.0f, 0.0f, 1.0f); + guMtxCatF(mtxPivot, mtxRotate, model->transformMatrix); + guTranslateF(mtxPivot, horse->offsetX, offsetY, horse->offsetZ); + guMtxCatF(model->transformMatrix, mtxPivot, model->transformMatrix); + } + return ApiStatus_BLOCK; +} + +EvtScript N(EVS_UpdateRockingHorse) = { + EVT_CALL(N(UpdateRockingHorse)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_THREAD + EVT_SETF(LVar0, EVT_FLOAT(0.0)) + EVT_SETF(LVar1, EVT_FLOAT(0.0)) + EVT_LOOP(0) + EVT_CALL(RotateModel, MODEL_o367, LVar1, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_hari, LVar0, 0, 0, 1) + EVT_SUBF(LVar0, EVT_FLOAT(0.6)) + EVT_SUBF(LVar1, EVT_FLOAT(7.2)) + EVT_CALL(ClampAngleFloat, LVar0) + EVT_CALL(ClampAngleFloat, LVar1) + EVT_WAIT(1) + EVT_END_LOOP + EVT_END_THREAD + EVT_EXEC(N(EVS_UpdateRockingHorse)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "omo_tex", + .shape = "omo_bt01_shape", + .hit = "omo_bt01_hit", + .bg = "omo_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_omo/omo_02.inc.c b/src/battle/common/stage/area_omo/omo_02.inc.c new file mode 100644 index 0000000000..dad776c8ce --- /dev/null +++ b/src/battle/common/stage/area_omo/omo_02.inc.c @@ -0,0 +1,25 @@ +#include "battle/battle.h" +#include "mapfs/omo_bt02_shape.h" + +#define NAMESPACE A(omo_02) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "omo_tex", + .shape = "omo_bt02_shape", + .hit = "omo_bt02_hit", + .bg = "omo_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_omo/omo_03.inc.c b/src/battle/common/stage/area_omo/omo_03.inc.c new file mode 100644 index 0000000000..66006f43b6 --- /dev/null +++ b/src/battle/common/stage/area_omo/omo_03.inc.c @@ -0,0 +1,26 @@ +#include "battle/battle.h" +#include "mapfs/omo_bt03_shape.h" + +#define NAMESPACE A(omo_03) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_g97, MODEL_GROUP_HIDDEN) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "omo_tex", + .shape = "omo_bt03_shape", + .hit = "omo_bt03_hit", + .bg = "omo_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_omo/omo_03b.inc.c b/src/battle/common/stage/area_omo/omo_03b.inc.c new file mode 100644 index 0000000000..ae9cf5b746 --- /dev/null +++ b/src/battle/common/stage/area_omo/omo_03b.inc.c @@ -0,0 +1,25 @@ +#include "battle/battle.h" +#include "mapfs/omo_bt03_shape.h" + +#define NAMESPACE A(omo_03b) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "omo_tex", + .shape = "omo_bt03_shape", + .hit = "omo_bt03_hit", + .bg = "omo_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_omo/omo_04.inc.c b/src/battle/common/stage/area_omo/omo_04.inc.c new file mode 100644 index 0000000000..8fc722c7a0 --- /dev/null +++ b/src/battle/common/stage/area_omo/omo_04.inc.c @@ -0,0 +1,63 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/omo_bt04_shape.h" + +#define NAMESPACE A(omo_04) + +extern Formation N(fromation_slot_machine); +extern ActorBlueprint N(slot_machine_stop); +extern ActorBlueprint N(slot_machine_start); + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetTexPanner, MODEL_o409, TEX_PANNER_A) + EVT_THREAD + EVT_SET(LVarE, 0) + EVT_LOOP(0) + EVT_ADD(LVarE, 0x8000) + EVT_CALL(SetTexPanOffset, TEX_PANNER_A, TEX_PANNER_MAIN, LVarE, 0) + EVT_WAIT(10) + EVT_END_LOOP + EVT_END_THREAD + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_itigo, + MODEL_kisya, + MODEL_kusari, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "omo_tex", + .shape = "omo_bt04_shape", + .hit = "omo_bt04_hit", + .bg = "omo_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), + .stageEnemyCount = 4, + .stageFormation = &N(fromation_slot_machine), +}; + +Vec3i N(slot_machine_pos1) = { -49, 56, -68 }; +Vec3i N(slot_machine_pos2) = { -13, 56, -68 }; +Vec3i N(slot_machine_pos3) = { 20, 56, -68 }; +Vec3i N(slot_machine_pos4) = { 53, 56, -68 }; + +Formation N(fromation_slot_machine) = { + ACTOR_BY_POS(N(slot_machine_start), N(slot_machine_pos1), 0, 0), + ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos2), 0, 1), + ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos3), 0, 2), + ACTOR_BY_POS(N(slot_machine_stop), N(slot_machine_pos4), 0, 3), +}; + +#include "battle/common/actor/slot_machine.inc.c" diff --git a/src/battle/common/stage/area_omo/omo_05.inc.c b/src/battle/common/stage/area_omo/omo_05.inc.c new file mode 100644 index 0000000000..805f39c990 --- /dev/null +++ b/src/battle/common/stage/area_omo/omo_05.inc.c @@ -0,0 +1,34 @@ +#include "battle/battle.h" +#include "mapfs/omo_bt05_shape.h" + +#define NAMESPACE A(omo_05) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_g1, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_dai1, MODEL_GROUP_HIDDEN) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_itigo, + MODEL_kisya, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "omo_tex", + .shape = "omo_bt05_shape", + .hit = "omo_bt05_hit", + .bg = "omo_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_omo/omo_05b.inc.c b/src/battle/common/stage/area_omo/omo_05b.inc.c new file mode 100644 index 0000000000..c0d70aea58 --- /dev/null +++ b/src/battle/common/stage/area_omo/omo_05b.inc.c @@ -0,0 +1,33 @@ +#include "battle/battle.h" +#include "mapfs/omo_bt05_shape.h" + +#define NAMESPACE A(omo_05b) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_g2, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_dai2, MODEL_GROUP_HIDDEN) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_mae2, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "omo_tex", + .shape = "omo_bt05_shape", + .hit = "omo_bt05_hit", + .bg = "omo_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_omo/omo_06.inc.c b/src/battle/common/stage/area_omo/omo_06.inc.c new file mode 100644 index 0000000000..604ce43fab --- /dev/null +++ b/src/battle/common/stage/area_omo/omo_06.inc.c @@ -0,0 +1,71 @@ +#include "battle/battle.h" +#include "mapfs/omo_bt06_shape.h" + +#define NAMESPACE A(omo_06) + +EvtScript N(EVS_UpdateMovingPlatforms) = { + EVT_SET(LVarA, LVar0) // modelID + EVT_SET(LVar9, LVar1) + EVT_SET(LVar8, LVar2) + EVT_LABEL(0) + EVT_CALL(MakeLerp, 0, LVar9, LVar8, EASING_COS_IN_OUT) + EVT_LOOP(0) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateGroup, LVarA, 0, LVar0, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 0) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_CALL(MakeLerp, LVar9, 0, LVar8, EASING_COS_IN_OUT) + EVT_LOOP(0) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateGroup, LVarA, 0, LVar0, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 0) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_THREAD + EVT_SET(LVar0, MODEL_ere1) + EVT_SET(LVar1, -50) + EVT_SET(LVar2, 120) + EVT_EXEC(N(EVS_UpdateMovingPlatforms)) + EVT_WAIT(10) + EVT_SET(LVar0, MODEL_ere2) + EVT_SET(LVar1, -80) + EVT_SET(LVar2, 150) + EVT_EXEC(N(EVS_UpdateMovingPlatforms)) + EVT_END_THREAD + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_kuruma, + MODEL_hosi, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "omo_tex", + .shape = "omo_bt06_shape", + .hit = "omo_bt06_hit", + .bg = "omo_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_omo/omo_07.inc.c b/src/battle/common/stage/area_omo/omo_07.inc.c new file mode 100644 index 0000000000..b7a4eb3d62 --- /dev/null +++ b/src/battle/common/stage/area_omo/omo_07.inc.c @@ -0,0 +1,23 @@ +#include "battle/battle.h" + +#define NAMESPACE A(omo_07) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "omo_tex", + .shape = "omo_bt07_shape", + .hit = "omo_bt07_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_pra/pra_01.inc.c b/src/battle/common/stage/area_pra/pra_01.inc.c new file mode 100644 index 0000000000..1d444b27c7 --- /dev/null +++ b/src/battle/common/stage/area_pra/pra_01.inc.c @@ -0,0 +1,34 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/pra_bt01_shape.h" + +#define NAMESPACE A(pra_01) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(EnableBattleFloorReflections, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o383, + MODEL_o384, + MODEL_o385, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "pra_tex", + .shape = "pra_bt01_shape", + .hit = "pra_bt01_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_pra/pra_02.inc.c b/src/battle/common/stage/area_pra/pra_02.inc.c new file mode 100644 index 0000000000..1fab3f1f83 --- /dev/null +++ b/src/battle/common/stage/area_pra/pra_02.inc.c @@ -0,0 +1,46 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/pra_bt02_shape.h" + +#define NAMESPACE A(pra_02) + +#include "battle/common/stage/lib/TexturePanner.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(EnableBattleFloorReflections, TRUE) + EVT_SET(LVar0, MODEL_o412) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_SET(LVar2, 3000) + EVT_SET(LVar3, 0) + EVT_EXEC(N(EVS_TexturePanMain)) + EVT_SET(LVar0, MODEL_o413) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_SET(LVar2, 3000) + EVT_SET(LVar3, 0) + EVT_EXEC(N(EVS_TexturePanMain)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o383, + MODEL_o384, + MODEL_o385, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "pra_tex", + .shape = "pra_bt02_shape", + .hit = "pra_bt02_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_pra/pra_03.inc.c b/src/battle/common/stage/area_pra/pra_03.inc.c new file mode 100644 index 0000000000..cc7e2c2a0e --- /dev/null +++ b/src/battle/common/stage/area_pra/pra_03.inc.c @@ -0,0 +1,24 @@ +#include "battle/battle.h" +#include "mapfs/pra_bt03_shape.h" + +#define NAMESPACE A(pra_03) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "pra_tex", + .shape = "pra_bt03_shape", + .hit = "pra_bt03_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_pra/pra_03b.inc.c b/src/battle/common/stage/area_pra/pra_03b.inc.c new file mode 100644 index 0000000000..55b8d6e792 --- /dev/null +++ b/src/battle/common/stage/area_pra/pra_03b.inc.c @@ -0,0 +1,25 @@ +#include "battle/battle.h" +#include "mapfs/pra_bt03_shape.h" + +#define NAMESPACE A(pra_03b) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_g115, MODEL_GROUP_HIDDEN) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "pra_tex", + .shape = "pra_bt03_shape", + .hit = "pra_bt03_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_pra/pra_03c.inc.c b/src/battle/common/stage/area_pra/pra_03c.inc.c new file mode 100644 index 0000000000..f80de62a40 --- /dev/null +++ b/src/battle/common/stage/area_pra/pra_03c.inc.c @@ -0,0 +1,26 @@ +#include "battle/battle.h" +#include "mapfs/pra_bt03_shape.h" + +#define NAMESPACE A(pra_03c) + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetGroupVisibility, MODEL_g115, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_g117, MODEL_GROUP_HIDDEN) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "pra_tex", + .shape = "pra_bt03_shape", + .hit = "pra_bt03_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_pra/pra_04.inc.c b/src/battle/common/stage/area_pra/pra_04.inc.c new file mode 100644 index 0000000000..98c7f2a928 --- /dev/null +++ b/src/battle/common/stage/area_pra/pra_04.inc.c @@ -0,0 +1,38 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/pra_bt04_shape.h" + +#define NAMESPACE A(pra_04) + +#include "battle/common/stage/lib/TexturePanner.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_SET(LVar0, MODEL_kira1) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_SET(LVar2, 3000) + EVT_SET(LVar3, 0) + EVT_EXEC(N(EVS_TexturePanMain)) + EVT_SET(LVar0, MODEL_kira2) + EVT_SET(LVar1, TEX_PANNER_1) + EVT_SET(LVar2, 3000) + EVT_SET(LVar3, 0) + EVT_EXEC(N(EVS_TexturePanMain)) + EVT_CALL(EnableBattleFloorReflections, TRUE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "pra_tex", + .shape = "pra_bt04_shape", + .hit = "pra_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_sam/sam_01.inc.c b/src/battle/common/stage/area_sam/sam_01.inc.c new file mode 100644 index 0000000000..e5967f1a36 --- /dev/null +++ b/src/battle/common/stage/area_sam/sam_01.inc.c @@ -0,0 +1,52 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/sam_bt01_shape.h" + +#define NAMESPACE A(sam_01) + +#include "battle/common/stage/lib/Snowflakes.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_EXEC(N(EVS_SpawnSnowfall)) + EVT_THREAD + EVT_SET(LVar0, MODEL_o262) + EVT_SET(LVar1, 1) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_o261) + EVT_SET(LVar1, 3) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_o260) + EVT_SET(LVar1, 4) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_o253) + EVT_SET(LVar1, 2) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) + EVT_END_THREAD + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + -1, + MODEL_saku, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "sam_tex", + .shape = "sam_bt01_shape", + .hit = "sam_bt01_hit", + .bg = "yki_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_sam/sam_02.inc.c b/src/battle/common/stage/area_sam/sam_02.inc.c new file mode 100644 index 0000000000..d681eebe8e --- /dev/null +++ b/src/battle/common/stage/area_sam/sam_02.inc.c @@ -0,0 +1,54 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/sam_bt02_shape.h" + +#define NAMESPACE A(sam_02) + +#include "battle/common/stage/lib/Snowflakes.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetGroupVisibility, MODEL_p2, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_p3, MODEL_GROUP_HIDDEN) + EVT_THREAD + EVT_SET(LVar0, MODEL_o253) + EVT_SET(LVar1, 0) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_o283) + EVT_SET(LVar1, 0) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_o284) + EVT_SET(LVar1, 0) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_o285) + EVT_SET(LVar1, 0) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) + EVT_END_THREAD + EVT_EXEC(N(EVS_SpawnSnowfall)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + -1, + MODEL_kouri1, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "sam_tex", + .shape = "sam_bt02_shape", + .hit = "sam_bt02_hit", + .bg = "yki_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_sam/sam_02b.inc.c b/src/battle/common/stage/area_sam/sam_02b.inc.c new file mode 100644 index 0000000000..5593014018 --- /dev/null +++ b/src/battle/common/stage/area_sam/sam_02b.inc.c @@ -0,0 +1,37 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/sam_bt02_shape.h" + +#define NAMESPACE A(sam_02b) + +#include "battle/common/stage/lib/Snowflakes.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetGroupVisibility, MODEL_p1, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_yuki, MODEL_GROUP_HIDDEN) + EVT_EXEC(N(EVS_SpawnSnowfall)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + -1, + MODEL_kouri1, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "sam_tex", + .shape = "sam_bt02_shape", + .hit = "sam_bt02_hit", + .bg = "yki_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_sam/sam_02c.inc.c b/src/battle/common/stage/area_sam/sam_02c.inc.c new file mode 100644 index 0000000000..707796bb18 --- /dev/null +++ b/src/battle/common/stage/area_sam/sam_02c.inc.c @@ -0,0 +1,38 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/sam_bt02_shape.h" + +#define NAMESPACE A(sam_02c) + +#include "battle/common/stage/lib/Snowflakes.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetGroupVisibility, MODEL_p1, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_p2, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_yuki, MODEL_GROUP_HIDDEN) + EVT_EXEC(N(EVS_SpawnSnowfall)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + -1, + MODEL_kouri1, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "sam_tex", + .shape = "sam_bt02_shape", + .hit = "sam_bt02_hit", + .bg = "yki_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_sam/sam_02d.inc.c b/src/battle/common/stage/area_sam/sam_02d.inc.c new file mode 100644 index 0000000000..4c462ecc74 --- /dev/null +++ b/src/battle/common/stage/area_sam/sam_02d.inc.c @@ -0,0 +1,39 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/sam_bt02_shape.h" + +#define NAMESPACE A(sam_02d) + +#include "battle/common/stage/lib/Snowflakes.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetGroupVisibility, MODEL_p1, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_p2, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_p3, MODEL_GROUP_HIDDEN) + EVT_CALL(SetGroupVisibility, MODEL_yuki, MODEL_GROUP_HIDDEN) + EVT_EXEC(N(EVS_SpawnSnowfall)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + -1, + MODEL_kouri1, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "sam_tex", + .shape = "sam_bt02_shape", + .hit = "sam_bt02_hit", + .bg = "yki_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_sam/sam_03.inc.c b/src/battle/common/stage/area_sam/sam_03.inc.c new file mode 100644 index 0000000000..3ec1235865 --- /dev/null +++ b/src/battle/common/stage/area_sam/sam_03.inc.c @@ -0,0 +1,56 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "mapfs/sam_bt03_shape.h" + +#define NAMESPACE A(sam_03) + +#include "battle/common/stage/lib/Snowflakes.inc.c" + +void N(EnableBackgroundWave)(void) { + enable_background_wave(); +} + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_THREAD + EVT_SET(LVar0, MODEL_Default) + EVT_SET(LVar1, 0) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_RandomSpin)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_g62) + EVT_SET(LVar1, 0) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_NoSpin)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_g60) + EVT_SET(LVar1, 0) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_NoSpin)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_g58) + EVT_SET(LVar1, 0) + EVT_EXEC(N(EVS_AnimateHangingSnowflake_NoSpin)) + EVT_END_THREAD + EVT_EXEC(N(EVS_SpawnSnowfall)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + -1, + MODEL_o278, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "sam_tex", + .shape = "sam_bt03_shape", + .hit = "sam_bt03_hit", + .bg = "sam_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_sam/sam_04.inc.c b/src/battle/common/stage/area_sam/sam_04.inc.c new file mode 100644 index 0000000000..21529f1d41 --- /dev/null +++ b/src/battle/common/stage/area_sam/sam_04.inc.c @@ -0,0 +1,31 @@ +#include "battle/battle.h" +#include "mapfs/sam_bt04_shape.h" + +#define NAMESPACE A(sam_04) + +#include "battle/common/stage/lib/Snowflakes.inc.c" + +void N(EnableBackgroundWave)(void) { + enable_background_wave(); +} + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_EXEC(N(EVS_SpawnSnowfall)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "sam_tex", + .shape = "sam_bt04_shape", + .hit = "sam_bt04_hit", + .bg = "sam_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_sbk/sbk_02.inc.c b/src/battle/common/stage/area_sbk/sbk_02.inc.c new file mode 100644 index 0000000000..bac57738ed --- /dev/null +++ b/src/battle/common/stage/area_sbk/sbk_02.inc.c @@ -0,0 +1,112 @@ +#include "battle/battle.h" +#include "mapfs/sbk_bt02_shape.h" + +#include "effects.h" +#include "model.h" + +#define NAMESPACE A(sbk_02) + +API_CALLABLE(N(UpdateSunPos)) { + Bytecode* args = script->ptrReadPos; + s32 outPosX; + s32 outPosY; + s32 outPosZ; + f32 x; + f32 y; + f32 z; + f32 angle; +#if !VERSION_PAL + Matrix4f mtxUnused; +#endif + + angle = evt_get_variable(script, *args++) / 10.0; + angle = angle * TAU; + angle = angle / 360.0f; + + outPosX = *args++; + outPosY = *args++; + outPosZ = *args++; + + x = sin_rad(angle) * 150.0f + 0.0f; + y = cos_rad(angle) * 150.0f + 0.0f; + z = -252.0f; + + x -= script->varTable[11]; + y -= script->varTable[12]; + z -= script->varTable[13]; + + evt_set_float_variable(script, outPosX, x); + evt_set_float_variable(script, outPosY, y); + evt_set_float_variable(script, outPosZ, z); + + return ApiStatus_DONE2; +} + +API_CALLABLE(N(GetModelPos)) { + s32 modelID = script->varTable[10]; + s32 modelIdx = get_model_list_index_from_tree_index(modelID); + Model* model = get_model_from_list_index(modelIdx); + + script->varTable[11] = (s32) model->center.x; + script->varTable[12] = (s32) model->center.y; + script->varTable[13] = (s32) model->center.z; + + return ApiStatus_DONE2; +} + +EvtScript N(EVS_UpdateSunPos) = { + EVT_SET(LVarA, LVar0) // modelID + EVT_SET(LVar7, LVar1) // initialPhase + EVT_MUL(LVar7, 10) + EVT_CALL(N(GetModelPos)) + EVT_LABEL(0) + EVT_ADD(LVar7, 1) + EVT_IF_GT(LVar7, 3599) + EVT_SUB(LVar7, 3600) + EVT_END_IF + EVT_CALL(N(UpdateSunPos), LVar7, LVar0, LVar1, LVar2) + EVT_CALL(TranslateModel, LVarA, LVar0, LVar1, LVar2) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_SET(LVar0, MODEL_g60) + EVT_SET(LVar1, 0) + EVT_EXEC(N(EVS_UpdateSunPos)) + EVT_SET(LVar0, MODEL_g63) + EVT_SET(LVar1, 120) + EVT_EXEC(N(EVS_UpdateSunPos)) + EVT_SET(LVar0, MODEL_g62) + EVT_SET(LVar1, 240) + EVT_EXEC(N(EVS_UpdateSunPos)) + EVT_PLAY_EFFECT(EFFECT_SUN, 0, 0, 0, 0, 0, 0, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_o322, + MODEL_o321, + MODEL_o320, + MODEL_o319, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "sbk_tex", + .shape = "sbk_bt02_shape", + .hit = "sbk_bt02_hit", + .bg = "sbk_bg", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; diff --git a/src/battle/common/stage/area_tik/tik_01.inc.c b/src/battle/common/stage/area_tik/tik_01.inc.c new file mode 100644 index 0000000000..c620e34a1d --- /dev/null +++ b/src/battle/common/stage/area_tik/tik_01.inc.c @@ -0,0 +1,50 @@ +#include "battle/battle.h" +#include "mapfs/tik_bt01_shape.h" + +#define NAMESPACE A(tik_01) + +#include "battle/common/stage/lib/TexturePanner.inc.c" + +#define DROPLET_MODEL MODEL_o351 +#include "battle/common/stage/lib/DripVolumes.inc.c" + +DripVolumeList N(DripVolumes) = { + .count = 1, + .volumes = { + { + .minPos = { -100, -50 }, + .maxPos = { 200, 100 }, + .startY = 200, + .endY = 0, + .duration = 60, + .density = 4, + } + } +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_SET(LVar0, MODEL_misu) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_SET(LVar2, 0) + EVT_SET(LVar3, -500) + EVT_EXEC(N(EVS_TexturePanMain)) + EVT_SET(LVar0, EVT_PTR(N(DripVolumes))) + EVT_EXEC(N(EVS_CreateDripVolumes)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "tik_tex", + .shape = "tik_bt01_shape", + .hit = "tik_bt01_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_tik/tik_02.inc.c b/src/battle/common/stage/area_tik/tik_02.inc.c new file mode 100644 index 0000000000..91aa0924bb --- /dev/null +++ b/src/battle/common/stage/area_tik/tik_02.inc.c @@ -0,0 +1,50 @@ +#include "battle/battle.h" +#include "mapfs/tik_bt02_shape.h" + +#define NAMESPACE A(tik_02) + +#include "battle/common/stage/lib/TexturePanner.inc.c" + +#define DROPLET_MODEL MODEL_o354 +#include "battle/common/stage/lib/DripVolumes.inc.c" + +DripVolumeList N(DripVolumes) = { + .count = 1, + .volumes = { + { + .minPos = { -100, -50 }, + .maxPos = { 200, 100 }, + .startY = 200, + .endY = 0, + .duration = 60, + .density = 4, + } + } +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_SET(LVar0, EVT_PTR(N(DripVolumes))) + EVT_EXEC(N(EVS_CreateDripVolumes)) + EVT_SET(LVar0, MODEL_misu) + EVT_SET(LVar1, TEX_PANNER_0) + EVT_SET(LVar2, 0) + EVT_SET(LVar3, -500) + EVT_EXEC(N(EVS_TexturePanMain)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "tik_tex", + .shape = "tik_bt02_shape", + .hit = "tik_bt02_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; diff --git a/src/battle/common/stage/area_tik/tik_03.inc.c b/src/battle/common/stage/area_tik/tik_03.inc.c new file mode 100644 index 0000000000..b3d3bf3310 --- /dev/null +++ b/src/battle/common/stage/area_tik/tik_03.inc.c @@ -0,0 +1,44 @@ +#include "battle/battle.h" +#include "mapfs/tik_bt03_shape.h" + +#define NAMESPACE A(tik_03) + +#define DROPLET_MODEL MODEL_o371 +#include "battle/common/stage/lib/DripVolumes.inc.c" + +DripVolumeList N(DripVolumes) = { + .count = 1, + .volumes = { + { + .minPos = { -100, -50 }, + .maxPos = { 200, 100 }, + .startY = 200, + .endY = 0, + .duration = 60, + .density = 4, + } + } +}; + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_SET(LVar0, EVT_PTR(N(DripVolumes))) + EVT_EXEC(N(EVS_CreateDripVolumes)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "tik_tex", + .shape = "tik_bt03_shape", + .hit = "tik_bt03_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; + diff --git a/src/battle/common/stage/area_tik/tik_04.inc.c b/src/battle/common/stage/area_tik/tik_04.inc.c new file mode 100644 index 0000000000..26526261b5 --- /dev/null +++ b/src/battle/common/stage/area_tik/tik_04.inc.c @@ -0,0 +1,53 @@ +#include "battle/battle.h" +#include "mapfs/tik_bt04_shape.h" + +#define NAMESPACE A(tik_04) + +#include "battle/common/stage/lib/WaterEffects.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_THREAD + EVT_SET(LVar0, MODEL_mizu2) + EVT_EXEC(N(EVS_AnimateWaveModel)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_mizu3) + EVT_EXEC(N(EVS_AnimateWaveModel)) + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_mizu4) + EVT_EXEC(N(EVS_AnimateWaveModel)) + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(5) + EVT_SET(LVar0, MODEL_o357) + EVT_SET(LVar1, 145) + EVT_EXEC(N(EVS_AnimateDrifting)) + EVT_SET(LVar0, MODEL_o361) + EVT_SET(LVar1, 145) + EVT_EXEC(N(EVS_AnimateDrifting)) + EVT_END_THREAD + EVT_SET(LVar0, MODEL_o358) + EVT_SET(LVar1, 60) + EVT_EXEC(N(EVS_AnimateDrifting)) + EVT_SET(LVar0, MODEL_o360) + EVT_SET(LVar1, 60) + EVT_EXEC(N(EVS_AnimateDrifting)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +Stage NAMESPACE = { + .texture = "tik_tex", + .shape = "tik_bt04_shape", + .hit = "tik_bt04_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), +}; + + diff --git a/src/battle/common/stage/area_tik/tik_05.inc.c b/src/battle/common/stage/area_tik/tik_05.inc.c new file mode 100644 index 0000000000..78fed1a83c --- /dev/null +++ b/src/battle/common/stage/area_tik/tik_05.inc.c @@ -0,0 +1,51 @@ +#include "battle/battle.h" +#include "mapfs/tik_bt05_shape.h" + +#define NAMESPACE A(tik_05) + +#include "world/common/atomic/TexturePan.inc.c" + +EvtScript N(EVS_PreBattle) = { + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_CALL(SetCamBGColor, CAM_BATTLE, 0, 0, 0) + EVT_CALL(SetTexPanner, MODEL_taki1, TEX_PANNER_1) + EVT_CALL(EnableTexPanning, MODEL_taki1, TRUE) + EVT_THREAD + TEX_PAN_PARAMS_ID(TEX_PANNER_1) + TEX_PAN_PARAMS_STEP( 0, -2700, 0, -3000) + TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1) + TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) + EVT_EXEC(N(EVS_UpdateTexturePan)) + EVT_END_THREAD + EVT_CALL(SetTexPanner, MODEL_taki2, TEX_PANNER_2) + EVT_CALL(EnableTexPanning, MODEL_taki2, TRUE) + EVT_THREAD + TEX_PAN_PARAMS_ID(TEX_PANNER_2) + TEX_PAN_PARAMS_STEP( 50, -200, 110, -500) + TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1) + TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) + EVT_EXEC(N(EVS_UpdateTexturePan)) + EVT_END_THREAD + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_PostBattle) = { + EVT_RETURN + EVT_END +}; + +s32 N(ForegroundModels)[] = { + MODEL_taki1, + STAGE_MODEL_LIST_END +}; + +Stage NAMESPACE = { + .texture = "tik_tex", + .shape = "tik_bt05_shape", + .hit = "tik_bt05_hit", + .preBattle = &N(EVS_PreBattle), + .postBattle = &N(EVS_PostBattle), + .foregroundModelList = N(ForegroundModels), +}; + diff --git a/src/battle/common/stage/trd_00.inc.c b/src/battle/common/stage/area_trd/trd_00.inc.c similarity index 96% rename from src/battle/common/stage/trd_00.inc.c rename to src/battle/common/stage/area_trd/trd_00.inc.c index 4ca00e2441..2cb3d1fe37 100644 --- a/src/battle/common/stage/trd_00.inc.c +++ b/src/battle/common/stage/area_trd/trd_00.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt00_shape.h" diff --git a/src/battle/common/stage/trd_01.inc.c b/src/battle/common/stage/area_trd/trd_01.inc.c similarity index 96% rename from src/battle/common/stage/trd_01.inc.c rename to src/battle/common/stage/area_trd/trd_01.inc.c index 1ca7546815..a6d68fb417 100644 --- a/src/battle/common/stage/trd_01.inc.c +++ b/src/battle/common/stage/area_trd/trd_01.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt01_shape.h" diff --git a/src/battle/common/stage/trd_02.inc.c b/src/battle/common/stage/area_trd/trd_02.inc.c similarity index 98% rename from src/battle/common/stage/trd_02.inc.c rename to src/battle/common/stage/area_trd/trd_02.inc.c index 1ead1ffe2e..4d398ac24c 100644 --- a/src/battle/common/stage/trd_02.inc.c +++ b/src/battle/common/stage/area_trd/trd_02.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt02_shape.h" diff --git a/src/battle/common/stage/trd_02b.inc.c b/src/battle/common/stage/area_trd/trd_02b.inc.c similarity index 98% rename from src/battle/common/stage/trd_02b.inc.c rename to src/battle/common/stage/area_trd/trd_02b.inc.c index 29f92f2a43..1179e1ee33 100644 --- a/src/battle/common/stage/trd_02b.inc.c +++ b/src/battle/common/stage/area_trd/trd_02b.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt02_shape.h" diff --git a/src/battle/common/stage/trd_02c.inc.c b/src/battle/common/stage/area_trd/trd_02c.inc.c similarity index 97% rename from src/battle/common/stage/trd_02c.inc.c rename to src/battle/common/stage/area_trd/trd_02c.inc.c index 3b30ecf09f..22c3a4773b 100644 --- a/src/battle/common/stage/trd_02c.inc.c +++ b/src/battle/common/stage/area_trd/trd_02c.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt02_shape.h" diff --git a/src/battle/common/stage/trd_02d.inc.c b/src/battle/common/stage/area_trd/trd_02d.inc.c similarity index 97% rename from src/battle/common/stage/trd_02d.inc.c rename to src/battle/common/stage/area_trd/trd_02d.inc.c index cdaa05598a..689c416f69 100644 --- a/src/battle/common/stage/trd_02d.inc.c +++ b/src/battle/common/stage/area_trd/trd_02d.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt02_shape.h" diff --git a/src/battle/common/stage/trd_03.inc.c b/src/battle/common/stage/area_trd/trd_03.inc.c similarity index 97% rename from src/battle/common/stage/trd_03.inc.c rename to src/battle/common/stage/area_trd/trd_03.inc.c index 3324511cf1..9fcd43f0b4 100644 --- a/src/battle/common/stage/trd_03.inc.c +++ b/src/battle/common/stage/area_trd/trd_03.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt03_shape.h" diff --git a/src/battle/common/stage/trd_04.inc.c b/src/battle/common/stage/area_trd/trd_04.inc.c similarity index 97% rename from src/battle/common/stage/trd_04.inc.c rename to src/battle/common/stage/area_trd/trd_04.inc.c index a34a058290..9f82e41916 100644 --- a/src/battle/common/stage/trd_04.inc.c +++ b/src/battle/common/stage/area_trd/trd_04.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt04_shape.h" diff --git a/src/battle/common/stage/trd_05.inc.c b/src/battle/common/stage/area_trd/trd_05.inc.c similarity index 98% rename from src/battle/common/stage/trd_05.inc.c rename to src/battle/common/stage/area_trd/trd_05.inc.c index e60c7242d0..077e313940 100644 --- a/src/battle/common/stage/trd_05.inc.c +++ b/src/battle/common/stage/area_trd/trd_05.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt05_shape.h" diff --git a/src/battle/common/stage/trd_05b.inc.c b/src/battle/common/stage/area_trd/trd_05b.inc.c similarity index 98% rename from src/battle/common/stage/trd_05b.inc.c rename to src/battle/common/stage/area_trd/trd_05b.inc.c index d9392ba1a6..6e947ee5d1 100644 --- a/src/battle/common/stage/trd_05b.inc.c +++ b/src/battle/common/stage/area_trd/trd_05b.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt05_shape.h" diff --git a/src/battle/common/stage/trd_05c.inc.c b/src/battle/common/stage/area_trd/trd_05c.inc.c similarity index 98% rename from src/battle/common/stage/trd_05c.inc.c rename to src/battle/common/stage/area_trd/trd_05c.inc.c index 5f117a3ef6..e1f9413ca9 100644 --- a/src/battle/common/stage/trd_05c.inc.c +++ b/src/battle/common/stage/area_trd/trd_05c.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt05_shape.h" diff --git a/src/battle/common/stage/trd_05d.inc.c b/src/battle/common/stage/area_trd/trd_05d.inc.c similarity index 98% rename from src/battle/common/stage/trd_05d.inc.c rename to src/battle/common/stage/area_trd/trd_05d.inc.c index 261f9121cf..45d9a7f746 100644 --- a/src/battle/common/stage/trd_05d.inc.c +++ b/src/battle/common/stage/area_trd/trd_05d.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt05_shape.h" diff --git a/src/battle/common/stage/trd_05e.inc.c b/src/battle/common/stage/area_trd/trd_05e.inc.c similarity index 97% rename from src/battle/common/stage/trd_05e.inc.c rename to src/battle/common/stage/area_trd/trd_05e.inc.c index ecba95ea9b..6401010536 100644 --- a/src/battle/common/stage/trd_05e.inc.c +++ b/src/battle/common/stage/area_trd/trd_05e.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt05_shape.h" diff --git a/src/battle/common/stage/trd_05f.inc.c b/src/battle/common/stage/area_trd/trd_05f.inc.c similarity index 97% rename from src/battle/common/stage/trd_05f.inc.c rename to src/battle/common/stage/area_trd/trd_05f.inc.c index 9e90eec96b..6cc417688d 100644 --- a/src/battle/common/stage/trd_05f.inc.c +++ b/src/battle/common/stage/area_trd/trd_05f.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "mapfs/trd_bt05_shape.h" diff --git a/src/battle/common/stage/lib/DripVolumes.inc.c b/src/battle/common/stage/lib/DripVolumes.inc.c new file mode 100644 index 0000000000..e4dd3737e7 --- /dev/null +++ b/src/battle/common/stage/lib/DripVolumes.inc.c @@ -0,0 +1,230 @@ +#include "common.h" +#include "model.h" + +#ifndef DROPLET_MODEL +#error DROPLET_MODEL must be defined for DripVolumes +#define DROPLET_MODEL 0 +#endif + +API_CALLABLE(N(CheckDripCollisionWithActors)) { + BattleStatus* battleStatus = &gBattleStatus; + Bytecode* args = script->ptrReadPos; + Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(evt_get_variable(script, *args++))); + f32 xDiff, yDiff, zDiff, temp; + Actor* actor; + s32 i; + + script->varTable[2] = 0; + + actor = battleStatus->playerActor; + if (actor != NULL) { + xDiff = actor->currentPos.x - model->center.x; + yDiff = actor->currentPos.y + actor->size.y - 1.5f - model->center.y; + zDiff = actor->currentPos.z - model->center.z; + temp = sqrtf(SQ(xDiff) + SQ(zDiff)); + + if (yDiff > 0.0f && yDiff < actor->size.y && temp < actor->size.x * 0.5f) { + script->varTable[2] = 1; + return ApiStatus_DONE2; + } + } + + actor = battleStatus->partnerActor; + if (actor != NULL) { + xDiff = actor->currentPos.x - model->center.x; + yDiff = actor->currentPos.y + actor->size.y - 1.5f - model->center.y; + zDiff = actor->currentPos.z - model->center.z; + temp = sqrtf(SQ(xDiff) + SQ(zDiff)); + + if (yDiff > 0.0f && yDiff < actor->size.y && temp < actor->size.x * 0.5f) { + script->varTable[2] = 1; + return ApiStatus_DONE2; + } + } + + for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { + ActorPart* part; + + actor = battleStatus->enemyActors[i]; + + if (actor != NULL && !(actor->flags & ACTOR_FLAG_DISABLED)) { + xDiff = actor->currentPos.x - model->center.x; + yDiff = actor->currentPos.y + actor->size.y - 1.5f - model->center.y; + zDiff = actor->currentPos.z - model->center.z; + temp = sqrtf(SQ(xDiff) + SQ(zDiff)); + + if (yDiff > 0.0f && yDiff < actor->size.y && temp < actor->size.x * 0.5f) { + script->varTable[2] = 1; + return ApiStatus_DONE2; + } + + for (part = actor->partsTable; part != NULL; part = part->nextPart) { + if (!(part->flags & ACTOR_PART_FLAG_INVISIBLE)) { + if (part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) { + xDiff = part->currentPos.x - model->center.x; + yDiff = part->currentPos.y + part->size.y - 1.5f - model->center.y; + zDiff = part->currentPos.z - model->center.z; + temp = sqrtf(SQ(xDiff) + SQ(zDiff)); + + if (yDiff > 0.0f && yDiff < part->size.y && temp < part->size.x * 0.5f) { + script->varTable[2] = 1; + return ApiStatus_DONE2; + } + } + } + } + } + } + return ApiStatus_DONE2; +} + +EvtScript N(EVS_UpdateDripSplash) = { + EVT_SET(LVar1, ArrayVar(5)) + EVT_ADD(LVar1, 1) + EVT_SET(LVar2, ArrayVar(0)) + EVT_SET(LVar3, ArrayVar(1)) + EVT_SET(LVar4, ArrayVar(5)) + EVT_ADD(LVar4, 2) + EVT_SET(LVar5, ArrayVar(0)) + EVT_SET(LVar6, ArrayVar(1)) + EVT_SET(LVar7, ArrayVar(5)) + EVT_ADD(LVar7, 3) + EVT_SET(LVar8, ArrayVar(0)) + EVT_SET(LVar9, ArrayVar(1)) + EVT_SET(LVarA, ArrayVar(5)) + EVT_ADD(LVarA, 4) + EVT_SET(LVarB, ArrayVar(0)) + EVT_SET(LVarC, ArrayVar(1)) + EVT_CALL(EnableModel, LVar1, TRUE) + EVT_CALL(EnableModel, LVar4, TRUE) + EVT_CALL(EnableModel, LVar7, TRUE) + EVT_CALL(EnableModel, LVarA, TRUE) + EVT_LOOP(5) + EVT_ADD(LVar0, 1) + EVT_ADD(LVar2, 1) + EVT_ADD(LVar3, 1) + EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) + EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_ADD(LVar5, -1) + EVT_ADD(LVar6, 1) + EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) + EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_ADD(LVar8, 1) + EVT_ADD(LVar9, -1) + EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) + EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_ADD(LVarB, -1) + EVT_ADD(LVarC, -1) + EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) + EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_WAIT(1) + EVT_END_LOOP + EVT_LOOP(5) + EVT_ADD(LVar0, -1) + EVT_ADD(LVar2, 1) + EVT_ADD(LVar3, 1) + EVT_CALL(TranslateModel, LVar1, LVar2, LVar0, LVar3) + EVT_CALL(ScaleModel, LVar1, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_ADD(LVar5, -1) + EVT_ADD(LVar6, 1) + EVT_CALL(TranslateModel, LVar4, LVar5, LVar0, LVar6) + EVT_CALL(ScaleModel, LVar4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_ADD(LVar8, 1) + EVT_ADD(LVar9, -1) + EVT_CALL(TranslateModel, LVar7, LVar8, LVar0, LVar9) + EVT_CALL(ScaleModel, LVar7, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_ADD(LVarB, -1) + EVT_ADD(LVarC, -1) + EVT_CALL(TranslateModel, LVarA, LVarB, LVar0, LVarC) + EVT_CALL(ScaleModel, LVarA, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(0.5)) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(EnableModel, LVar1, FALSE) + EVT_CALL(EnableModel, LVar4, FALSE) + EVT_CALL(EnableModel, LVar7, FALSE) + EVT_CALL(EnableModel, LVarA, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_UpdateDripVolume) = { + EVT_SET_GROUP(0) + EVT_USE_ARRAY(LVarA) + EVT_SET(LVar5, ArrayVar(5)) + EVT_LOOP(5) + EVT_CALL(CloneModel, DROPLET_MODEL, LVar5) + EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) + EVT_ADD(LVar5, 1) + EVT_END_LOOP + EVT_LABEL(0) + EVT_CALL(RandInt, 200, LVar0) + EVT_ADD(LVar0, 50) + EVT_WAIT(LVar0) + EVT_CALL(EnableModel, ArrayVar(5), TRUE) + EVT_CALL(MakeLerp, ArrayVar(2), ArrayVar(3), ArrayVar(4), EASING_QUADRATIC_IN) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, ArrayVar(5), ArrayVar(0), LVar0, ArrayVar(1)) + EVT_WAIT(1) + EVT_CALL(N(CheckDripCollisionWithActors), ArrayVar(5)) + EVT_IF_EQ(LVar2, 1) + EVT_GOTO(10) + EVT_END_IF + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_LABEL(10) + EVT_CALL(EnableModel, ArrayVar(5), FALSE) + EVT_EXEC_WAIT(N(EVS_UpdateDripSplash)) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_CreateDripVolumes) = { + EVT_SET(LVarF, CLONED_MODEL(0)) + EVT_USE_BUF(LVar0) + EVT_BUF_READ1(LVar1) + EVT_LOOP(LVar1) + EVT_BUF_READ4(LVar2, LVar3, LVar4, LVar5) + EVT_BUF_READ3(LVar6, LVar7, LVar8) + EVT_BUF_READ1(LVar9) + EVT_LOOP(LVar9) + EVT_MALLOC_ARRAY(6, LVarA) + EVT_USE_ARRAY(LVarA) + EVT_CALL(RandInt, LVar4, LVarB) + EVT_CALL(RandInt, LVar5, LVarC) + EVT_SET(LVarD, LVar2) + EVT_SET(LVarE, LVar3) + EVT_ADD(LVarD, LVarB) + EVT_ADD(LVarE, LVarC) + EVT_SET(ArrayVar(0), LVarD) + EVT_SET(ArrayVar(1), LVarE) + EVT_SET(ArrayVar(2), LVar6) + EVT_SET(ArrayVar(3), LVar7) + EVT_SET(ArrayVar(4), LVar8) + EVT_SET(ArrayVar(5), LVarF) + EVT_CHILD_THREAD + EVT_EXEC(N(EVS_UpdateDripVolume)) + EVT_END_CHILD_THREAD + EVT_ADD(LVarF, 5) + EVT_END_LOOP + EVT_END_LOOP + EVT_CALL(EnableModel, DROPLET_MODEL, FALSE) + EVT_RETURN + EVT_END +}; + +typedef struct DripVolume { + /* 0x00 */ Vec2i minPos; + /* 0x08 */ Vec2i maxPos; + /* 0x10 */ s32 startY; + /* 0x14 */ s32 endY; + /* 0x18 */ s32 duration; + /* 0x1C */ s32 density; +} DripVolume; + +typedef struct DripVolumeList { + /* 0x00 */ s32 count; + /* 0x04 */ DripVolume volumes[VLA]; +} DripVolumeList; // size = variable diff --git a/src/battle/common/stage/lib/Snowflakes.inc.c b/src/battle/common/stage/lib/Snowflakes.inc.c index b45df678c1..104d1db7bc 100644 --- a/src/battle/common/stage/lib/Snowflakes.inc.c +++ b/src/battle/common/stage/lib/Snowflakes.inc.c @@ -75,7 +75,7 @@ EvtScript N(EVS_RandomlySpinSnowflake) = { }; EvtScript N(EVS_AnimateHangingSnowflake_RandomSpin) = { - EVT_SET(LVarA, LVar0) // model + EVT_SET(LVarA, LVar0) // modelID EVT_SET(LVarB, LVar1) EVT_EXEC(N(EVS_RandomlySpinSnowflake)) EVT_SET(LVar7, 0) diff --git a/src/battle/common/stage/lib/TexturePanner.inc.c b/src/battle/common/stage/lib/TexturePanner.inc.c index f7fe826934..fa4add3cdd 100644 --- a/src/battle/common/stage/lib/TexturePanner.inc.c +++ b/src/battle/common/stage/lib/TexturePanner.inc.c @@ -1,9 +1,10 @@ #include "common.h" // pan the main tile along U and V +// (in) LVar0 : modelID // (in) LVar1 : tex panner ID // (in) LVar2 : main du -// (in) LVar2 : main dv +// (in) LVar3 : main dv EvtScript N(EVS_TexturePanMain) = { EVT_SET(LVarA, LVar1) EVT_SET(LVarB, LVar2) @@ -22,9 +23,10 @@ EvtScript N(EVS_TexturePanMain) = { }; // pan the main and aux tiles along U +// (in) LVar0 : modelID // (in) LVar1 : tex panner ID // (in) LVar2 : main du -// (in) LVar2 : aux du +// (in) LVar3 : aux du EvtScript N(EVS_TexturePanBothU) = { EVT_SET(LVarA, LVar1) EVT_SET(LVarB, LVar2) @@ -44,9 +46,10 @@ EvtScript N(EVS_TexturePanBothU) = { }; // pan the main and aux tiles along V +// (in) LVar0 : modelID // (in) LVar1 : tex panner ID // (in) LVar2 : main dv -// (in) LVar2 : aux dv +// (in) LVar3 : aux dv EvtScript N(EVS_TexturePanBothV) = { EVT_SET(LVarA, LVar1) EVT_SET(LVarB, LVar2) diff --git a/src/battle/common/stage/lib/WaterEffects.inc.c b/src/battle/common/stage/lib/WaterEffects.inc.c index 69f865c526..2cadf16f10 100644 --- a/src/battle/common/stage/lib/WaterEffects.inc.c +++ b/src/battle/common/stage/lib/WaterEffects.inc.c @@ -252,20 +252,21 @@ EvtScript N(EVS_AnimateWaveModel) = { EVT_END }; -s32 N(intTable_8021CD64)[] = { +s32 N(DriftBobbingOffsets)[] = { 0, -1, -1, -2, -2, -3, -5, -8, -8, -7, -6, -4, -2, -1, 0, 255, }; -EvtScript N(script3) = { - EVT_SET(LVarA, LVar0) +EvtScript N(EVS_AnimateDrifting) = { + EVT_SET(LVarA, LVar0) // modelID EVT_SET(LVarB, LVar1) EVT_SET(LVar5, 5) - EVT_USE_BUF(EVT_PTR(N(intTable_8021CD64))) + EVT_USE_BUF(EVT_PTR(N(DriftBobbingOffsets))) EVT_LABEL(0) + // drift along from left to right EVT_BUF_READ1(LVar1) EVT_IF_EQ(LVar1, 255) - EVT_USE_BUF(EVT_PTR(N(intTable_8021CD64))) + EVT_USE_BUF(EVT_PTR(N(DriftBobbingOffsets))) EVT_BUF_READ1(LVar1) EVT_END_IF EVT_SET(LVar0, LVar5) @@ -288,6 +289,7 @@ EvtScript N(script3) = { EVT_END_IF EVT_GOTO(0) EVT_LABEL(1) + // fall down EVT_SET(LVar2, 0) EVT_LOOP(20) EVT_ADD(LVar5, 1) @@ -296,6 +298,7 @@ EvtScript N(script3) = { EVT_CALL(TranslateModel, LVarA, LVar0, LVar1, 0) EVT_WAIT(1) EVT_END_LOOP + // reset to left side of stage EVT_SUB(LVar5, 280) EVT_SET(LVar1, 0) EVT_GOTO(0) diff --git a/src/battle/move/star_power/up_and_away.c b/src/battle/move/star_power/up_and_away.c index 9cc2f0ad5f..e5ecfdde5a 100644 --- a/src/battle/move/star_power/up_and_away.c +++ b/src/battle/move/star_power/up_and_away.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/BattleKalmar.h" diff --git a/src/battle/partner/bombette.c b/src/battle/partner/bombette.c index d95d6272bd..6a8eca326f 100644 --- a/src/battle/partner/bombette.c +++ b/src/battle/partner/bombette.c @@ -364,7 +364,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_END_CASE_GROUP @@ -572,7 +572,7 @@ EvtScript N(handleEvent) = { EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(EVS_Partner_Drop) EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Idle) EVT_SET_CONST(LVar2, ANIM_BattleBombette_Run) EVT_SET(LVar3, 0) @@ -580,7 +580,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_18) EVT_CASE_OR_EQ(EVENT_BLOCK) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Block) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_WAIT(10) @@ -611,7 +611,7 @@ EvtScript N(takeTurn) = { }; EvtScript N(celebrate) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_CelebrateLoop) EVT_SET_CONST(LVar2, ANIM_BattleBombette_Celebrate) EVT_SET_CONST(LVar3, ANIM_BattleBombette_Idle) @@ -664,7 +664,7 @@ EvtScript N(firstStrike) = { }; EvtScript N(runAway) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Run) EVT_EXEC_WAIT(EVS_Partner_RunAway) EVT_RETURN diff --git a/src/battle/partner/bow.c b/src/battle/partner/bow.c index 2dc6cd2aba..441a74829b 100644 --- a/src/battle/partner/bow.c +++ b/src/battle/partner/bow.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "effects.h" @@ -258,7 +257,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_END_CASE_GROUP @@ -289,7 +288,7 @@ EvtScript N(handleEvent) = { EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(EVS_Partner_Drop) EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Idle) EVT_SET_CONST(LVar2, ANIM_BattleBow_Run) EVT_SET(LVar3, 20) @@ -297,7 +296,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_18) EVT_CASE_OR_EQ(EVENT_BLOCK) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Block) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_WAIT(10) @@ -334,7 +333,7 @@ EvtScript N(celebrate) = { }; EvtScript N(runAway) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleBow_Run) EVT_EXEC_WAIT(EVS_Partner_RunAway) EVT_RETURN diff --git a/src/battle/partner/goombario.c b/src/battle/partner/goombario.c index a84393da76..6cecb50520 100644 --- a/src/battle/partner/goombario.c +++ b/src/battle/partner/goombario.c @@ -587,7 +587,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_END_CASE_GROUP @@ -619,7 +619,7 @@ EvtScript N(handleEvent) = { EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(EVS_Partner_Drop) EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Idle) EVT_SET_CONST(LVar2, ANIM_BattleGoombario_Run) EVT_SET(LVar3, 0) @@ -627,7 +627,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_18) EVT_CASE_OR_EQ(EVENT_BLOCK) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Block) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_WAIT(10) @@ -658,7 +658,7 @@ EvtScript N(takeTurn) = { }; EvtScript N(celebrate) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_CelebrateLoop) EVT_SET_CONST(LVar2, ANIM_BattleGoombario_Celebrate) EVT_SET_CONST(LVar3, ANIM_BattleGoombario_Idle) diff --git a/src/battle/partner/goompa.c b/src/battle/partner/goompa.c index 0277248347..6c4ad0ab9a 100644 --- a/src/battle/partner/goompa.c +++ b/src/battle/partner/goompa.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Goompa.h" @@ -99,14 +98,14 @@ EvtScript N(handleEvent) = { EVT_SWITCH(LVar0) EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goompa_Injured) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_END_CASE_GROUP EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(PlaySound, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goompa_Injured) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_END_CASE_GROUP @@ -128,7 +127,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CASE_EQ(EVENT_33) EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goompa_Idle) EVT_SET_CONST(LVar2, ANIM_Goompa_Run) EVT_EXEC_WAIT(EVS_Partner_Recover) @@ -156,7 +155,7 @@ EvtScript N(takeTurn) = { }; EvtScript N(celebrate) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goompa_Celebrate) EVT_SET_CONST(LVar2, ANIM_Goompa_Walk) EVT_EXEC_WAIT(EVS_Partner_Celebrate) @@ -165,7 +164,7 @@ EvtScript N(celebrate) = { }; EvtScript N(runAway) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Goompa_Run) EVT_EXEC_WAIT(EVS_Partner_RunAway) EVT_RETURN diff --git a/src/battle/partner/kooper.c b/src/battle/partner/kooper.c index f74a14e243..796b03c634 100644 --- a/src/battle/partner/kooper.c +++ b/src/battle/partner/kooper.c @@ -291,7 +291,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_END_CASE_GROUP @@ -315,7 +315,7 @@ EvtScript N(handleEvent) = { EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Partner_Drop) EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_SET(LVar2, 16) EVT_EXEC_WAIT(EVS_Partner_ShockHit) @@ -323,7 +323,7 @@ EvtScript N(handleEvent) = { EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(EVS_Partner_Drop) EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Idle) EVT_SET_CONST(LVar2, ANIM_BattleKooper_Run) EVT_SET(LVar3, 0) @@ -331,7 +331,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_18) EVT_CASE_OR_EQ(EVENT_BLOCK) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_LowerShell) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_WAIT(10) @@ -363,7 +363,7 @@ EvtScript N(takeTurn) = { }; EvtScript N(celebrate) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Celebrate) EVT_SET_CONST(LVar2, ANIM_BattleKooper_Walk) EVT_SET_CONST(LVar3, ANIM_BattleKooper_Idle) @@ -373,7 +373,7 @@ EvtScript N(celebrate) = { }; EvtScript N(runAway) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Run) EVT_EXEC_WAIT(EVS_Partner_RunAway) EVT_RETURN diff --git a/src/battle/partner/lakilester.c b/src/battle/partner/lakilester.c index 0e61ce610c..4908ec202f 100644 --- a/src/battle/partner/lakilester.c +++ b/src/battle/partner/lakilester.c @@ -212,7 +212,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_END_CASE_GROUP @@ -243,7 +243,7 @@ EvtScript N(handleEvent) = { EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(EVS_Partner_Drop) EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Walk) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_Run) EVT_SET(LVar3, 10) @@ -251,7 +251,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_18) EVT_CASE_OR_EQ(EVENT_BLOCK) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Block) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_WAIT(10) @@ -280,7 +280,7 @@ EvtScript N(takeTurn) = { }; EvtScript N(celebrate) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Celebrate) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_Walk) EVT_SET_CONST(LVar3, ANIM_BattleLakilester_Walk) @@ -290,7 +290,7 @@ EvtScript N(celebrate) = { }; EvtScript N(runAway) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Run) EVT_EXEC_WAIT(EVS_Partner_RunAway) EVT_RETURN diff --git a/src/battle/partner/parakarry.c b/src/battle/partner/parakarry.c index c7c2372b88..1e89f93675 100644 --- a/src/battle/partner/parakarry.c +++ b/src/battle/partner/parakarry.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "hud_element.h" @@ -727,12 +726,12 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_HurtStill) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SPIKE_CONTACT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_HurtStill) EVT_SET(LVar2, 22) EVT_EXEC_WAIT(EVS_Partner_SpikeContact) @@ -754,7 +753,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(EVS_Partner_Drop) EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SHOCK_HIT) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_HurtStill) EVT_SET(LVar2, 22) EVT_EXEC_WAIT(EVS_Partner_ShockHit) @@ -769,7 +768,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_18) EVT_CASE_OR_EQ(EVENT_BLOCK) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_OrientShell) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_WAIT(10) @@ -801,7 +800,7 @@ EvtScript N(takeTurn) = { }; EvtScript N(celebrate) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Celebrate) EVT_SET_CONST(LVar2, ANIM_BattleParakarry_Walk) EVT_SET_CONST(LVar3, ANIM_BattleParakarry_Idle) @@ -854,7 +853,7 @@ EvtScript N(firstStrike) = { }; EvtScript N(runAway) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Run) EVT_EXEC_WAIT(EVS_Partner_RunAway) EVT_RETURN diff --git a/src/battle/partner/sushie.c b/src/battle/partner/sushie.c index a1b5cfa916..466497a00e 100644 --- a/src/battle/partner/sushie.c +++ b/src/battle/partner/sushie.c @@ -496,7 +496,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_END_CASE_GROUP @@ -527,7 +527,7 @@ EvtScript N(handleEvent) = { EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(EVS_Partner_Drop) EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Idle) EVT_SET_CONST(LVar2, ANIM_BattleSushie_Run) EVT_SET(LVar3, 0) @@ -535,7 +535,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_18) EVT_CASE_OR_EQ(EVENT_BLOCK) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Block) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_WAIT(10) @@ -572,7 +572,7 @@ EvtScript N(celebrate) = { }; EvtScript N(runAway) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Run) EVT_EXEC_WAIT(EVS_Partner_RunAway) EVT_RETURN diff --git a/src/battle/partner/twink.c b/src/battle/partner/twink.c index c955148348..6e82385dd7 100644 --- a/src/battle/partner/twink.c +++ b/src/battle/partner/twink.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "sprite/npc/Twink.h" @@ -151,7 +150,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_HIT_COMBO) EVT_CASE_OR_EQ(EVENT_HIT) EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Peach2_Gasp) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Twink_Hurt) EVT_EXEC_WAIT(EVS_Enemy_Hit) EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Peach1_Walk) @@ -159,7 +158,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Peach2_Gasp) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Twink_Angry) EVT_EXEC_WAIT(EVS_Enemy_NoDamageHit) EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Peach1_Walk) @@ -188,7 +187,7 @@ EvtScript N(takeTurn) = { }; EvtScript N(celebrate) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Twink_Fly) EVT_SET_CONST(LVar2, ANIM_Twink_Fly) EVT_EXEC_WAIT(EVS_Partner_Celebrate) @@ -197,7 +196,7 @@ EvtScript N(celebrate) = { }; EvtScript N(runAway) = { - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_Twink_Angry) EVT_EXEC_WAIT(EVS_Partner_RunAway) EVT_RETURN diff --git a/src/battle/partner/watt.c b/src/battle/partner/watt.c index 34560ba090..7c96535f2c 100644 --- a/src/battle/partner/watt.c +++ b/src/battle/partner/watt.c @@ -559,7 +559,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_ZERO_DAMAGE) EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_CALL(N(WattFXBounce)) @@ -594,7 +594,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(EVS_Partner_Drop) EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_CALL(N(WattFXBounce)) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Idle) EVT_SET_CONST(LVar2, ANIM_BattleWatt_Run) EVT_SET(LVar3, 20) @@ -605,7 +605,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_18) EVT_CASE_OR_EQ(EVENT_BLOCK) EVT_CALL(PlaySoundAtActor, ACTOR_PARTNER, SOUND_208C) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Block) EVT_EXEC_WAIT(EVS_Partner_NoDamageHit) EVT_WAIT(10) @@ -640,7 +640,7 @@ EvtScript N(takeTurn) = { EvtScript N(celebrate) = { EVT_CALL(N(WattFXEnable)) EVT_CALL(N(WattFXSetEffect), 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Celebrate) EVT_SET_CONST(LVar2, ANIM_BattleWatt_Walk) EVT_SET_CONST(LVar3, ANIM_BattleWatt_Idle) @@ -652,7 +652,7 @@ EvtScript N(celebrate) = { EvtScript N(runAway) = { EVT_CALL(N(WattFXEnable)) EVT_CALL(N(WattFXSetEffect), 1) - EVT_SET_CONST(LVar0, 1) + EVT_SET_CONST(LVar0, PRT_MAIN) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Run) EVT_EXEC_WAIT(EVS_Partner_RunAway) EVT_RETURN diff --git a/src/common/DivActorLevel4.inc.c b/src/common/DivActorLevel4.inc.c index efa37cc146..81a210e526 100644 --- a/src/common/DivActorLevel4.inc.c +++ b/src/common/DivActorLevel4.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" API_CALLABLE(N(DivActorLevel4)) { diff --git a/src/common/GetModelPos.inc.c b/src/common/GetModelPos.inc.c deleted file mode 100644 index d647d579cc..0000000000 --- a/src/common/GetModelPos.inc.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "common.h" -#include "model.h" - -API_CALLABLE(N(GetModelPos)) { - Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(script->varTable[10])); - - script->varTable[11] = (s32) model->center.x; - script->varTable[12] = (s32) model->center.y; - script->varTable[13] = (s32) model->center.z; - - return ApiStatus_DONE2; -} diff --git a/src/common/SetSpinSmashable.inc.c b/src/common/SetSpinSmashable.inc.c index 09519db455..2ac01b6bbb 100644 --- a/src/common/SetSpinSmashable.inc.c +++ b/src/common/SetSpinSmashable.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" API_CALLABLE(N(SetSpinSmashable)) { diff --git a/src/common/UnkFloatFunc005.inc.c b/src/common/UnkFloatFunc005.inc.c index dd50b91545..324f14e589 100644 --- a/src/common/UnkFloatFunc005.inc.c +++ b/src/common/UnkFloatFunc005.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" API_CALLABLE(N(UnkFloatFunc005)) { diff --git a/src/common/UnkFogFunc.inc.c b/src/common/UnkFogFunc.inc.c deleted file mode 100644 index c5d293be3b..0000000000 --- a/src/common/UnkFogFunc.inc.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "common.h" - -API_CALLABLE(N(UnkFogFunc)) { - set_world_fog_dist(980, 1000); - set_world_fog_color(15, 5, 55, 255); - enable_world_fog(); - return ApiStatus_DONE2; -} diff --git a/src/common/UnkFogFunc2.inc.c b/src/common/UnkFogFunc2.inc.c deleted file mode 100644 index 03e751530c..0000000000 --- a/src/common/UnkFogFunc2.inc.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "common.h" - -API_CALLABLE(N(UnkFogFunc2)) { - enable_world_fog(); - set_world_fog_dist(950, 1000); - set_world_fog_color(16, 16, 16, 255); - gCameras[CAM_BATTLE].bgColor[0] = 20; - gCameras[CAM_BATTLE].bgColor[1] = 20; - gCameras[CAM_BATTLE].bgColor[2] = 28; - - return ApiStatus_DONE2; -} diff --git a/src/common/UpdateSunPos.inc.c b/src/common/UpdateSunPos.inc.c deleted file mode 100644 index ab02b6cc95..0000000000 --- a/src/common/UpdateSunPos.inc.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "common.h" -#include "battle/battle.h" - -API_CALLABLE(N(UpdateSunPos)) { - Bytecode* args = script->ptrReadPos; - s32 outPosX; - s32 outPosY; - s32 outPosZ; - f32 x; - f32 y; - f32 z; - f32 angle; - // Needed to make stack allocations line up -#if !VERSION_PAL - s8 unused[0x40]; -#endif - - angle = evt_get_variable(script, *args++) / 10.0; - angle = angle * TAU; - angle = angle / 360.0f; - - outPosX = *args++; - outPosY = *args++; - outPosZ = *args++; - - x = sin_rad(angle) * 150.0f + 0.0f; - y = cos_rad(angle) * 150.0f + 0.0f; - z = -252.0f; - - x -= script->varTable[11]; - y -= script->varTable[12]; - z -= script->varTable[13]; - - evt_set_float_variable(script, outPosX, x); - evt_set_float_variable(script, outPosY, y); - evt_set_float_variable(script, outPosZ, z); - - return ApiStatus_DONE2; -} diff --git a/src/encounter.c b/src/encounter.c index 55cb7e5d70..086a404edb 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" #include "script_api/battle.h" #include "npc.h" diff --git a/src/world/area_jan/jan_11/jan_11_2_main.c b/src/world/area_jan/jan_11/jan_11_2_main.c index 01c73a761b..28aeae51d8 100644 --- a/src/world/area_jan/jan_11/jan_11_2_main.c +++ b/src/world/area_jan/jan_11/jan_11_2_main.c @@ -4,7 +4,7 @@ #include "world/common/entity/Pipe.inc.c" -#define MODEL_sizuku MODEL_o140 //TODO parameterize all DripVolume includes +#define DROPLET_MODEL MODEL_o140 #include "world/area_tik/common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_obk/obk_07/obk_07_6_phonograph.c b/src/world/area_obk/obk_07/obk_07_6_phonograph.c index 5964c07724..22446abf88 100644 --- a/src/world/area_obk/obk_07/obk_07_6_phonograph.c +++ b/src/world/area_obk/obk_07/obk_07_6_phonograph.c @@ -256,9 +256,9 @@ void N(worker_update_phonograph_hud)(void) { id = data->barFillWidth / 60; // TODO use of id required to match - weird if (id <= 50) { temp = 50.0f; - temp *= sin_rad((((id * 90) / 50) * TAU) / 360.0f); + temp *= sin_rad(DEG_TO_RAD((id * 90) / 50)); } else { - temp = ((1.0 - sin_rad((((((id - 50) * 90) / 50) + 90) * TAU) / 360.0f)) * 50.0) + 50.0; + temp = ((1.0 - sin_rad(DEG_TO_RAD((((id - 50) * 90) / 50) + 90))) * 50.0) + 50.0; } data->timeScale = (((100 - temp) * 0.25) / 100.0) + ((2.0 * temp) / 100.0); snd_song_set_playback_rate(data->songName, data->timeScale); diff --git a/src/world/area_omo/omo_09/omo_09_7_npc.c b/src/world/area_omo/omo_09/omo_09_7_npc.c index 2344652600..96f2196fe6 100644 --- a/src/world/area_omo/omo_09/omo_09_7_npc.c +++ b/src/world/area_omo/omo_09/omo_09_7_npc.c @@ -108,7 +108,7 @@ EvtScript N(EVS_NpcIdle_Pokey) = { EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) EVT_CALL(SetCamProperties, CAM_DEFAULT, EVT_FLOAT(5.0), LVar0, LVar1, LVar2, 300, EVT_FLOAT(13.0), EVT_FLOAT(-9.5)) EVT_IF_EQ(GB_OMO_PeachChoice3, 0) - EVT_CALL(SpeakToPlayer, NPC_Pokey, ANIM_Pokey_Anim04, ANIM_Pokey_Anim04, 0, MSG_CH4_003E) + EVT_CALL(SpeakToPlayer, NPC_Pokey, ANIM_Pokey_Idle4, ANIM_Pokey_Idle4, 0, MSG_CH4_003E) EVT_ELSE EVT_CALL(SpeakToPlayer, NPC_Koopatrol, ANIM_WorldKoopatrol_Anim08, ANIM_WorldKoopatrol_Anim01, 0, MSG_CH4_003F) EVT_END_IF diff --git a/src/world/area_pra/pra_01/pra_01_2_main.c b/src/world/area_pra/pra_01/pra_01_2_main.c index d6f6e51a84..3db8dc01e6 100644 --- a/src/world/area_pra/pra_01/pra_01_2_main.c +++ b/src/world/area_pra/pra_01/pra_01_2_main.c @@ -99,7 +99,12 @@ EvtScript N(EVS_EnterMap) = { EVT_END }; -#include "common/UnkFogFunc.inc.c" +API_CALLABLE(N(SetupFog)) { + set_world_fog_dist(980, 1000); + set_world_fog_color(15, 5, 55, 255); + enable_world_fog(); + return ApiStatus_DONE2; +} API_CALLABLE(N(DisableFloorReflection)) { gOverrideFlags &= ~GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION; @@ -116,7 +121,7 @@ EvtScript N(EVS_Main) = { EVT_END_IF EVT_EXEC_WAIT(N(EVS_MakeEntities)) EVT_EXEC_WAIT(N(EVS_SetupMusic)) - EVT_CALL(N(UnkFogFunc)) + EVT_CALL(N(SetupFog)) EVT_CALL(N(DisableFloorReflection)) EVT_SET(LVar0, MODEL_o549) EVT_SET(LVar1, MODEL_o549) diff --git a/src/world/area_tik/common/DripVolumes.inc.c b/src/world/area_tik/common/DripVolumes.inc.c index eb394efa56..53ec20bf3d 100644 --- a/src/world/area_tik/common/DripVolumes.inc.c +++ b/src/world/area_tik/common/DripVolumes.inc.c @@ -2,6 +2,11 @@ #include "npc.h" #include "model.h" +#ifndef DROPLET_MODEL +#error DROPLET_MODEL must be defined for DripVolumes +#define DROPLET_MODEL 0 +#endif + API_CALLABLE(N(CheckDripCollisionWithNPC)) { PlayerStatus* playerStatus = &gPlayerStatus; Bytecode* args = script->ptrReadPos; @@ -123,7 +128,7 @@ EvtScript N(EVS_UpdateDripVolume) = { EVT_USE_ARRAY(LVarA) EVT_SET(LVar5, ArrayVar(5)) EVT_LOOP(5) - EVT_CALL(CloneModel, MODEL_sizuku, LVar5) + EVT_CALL(CloneModel, DROPLET_MODEL, LVar5) EVT_CALL(TranslateModel, LVar5, ArrayVar(0), ArrayVar(2), ArrayVar(1)) EVT_ADD(LVar5, 1) EVT_END_LOOP @@ -180,7 +185,7 @@ EvtScript N(EVS_CreateDripVolumes) = { EVT_ADD(LVarF, 5) EVT_END_LOOP EVT_END_LOOP - EVT_CALL(EnableModel, MODEL_sizuku, FALSE) + EVT_CALL(EnableModel, DROPLET_MODEL, FALSE) EVT_RETURN EVT_END }; diff --git a/src/world/area_tik/tik_01/tik_01_3_drips.c b/src/world/area_tik/tik_01/tik_01_3_drips.c index aef8c320d8..6fb77b50d0 100644 --- a/src/world/area_tik/tik_01/tik_01_3_drips.c +++ b/src/world/area_tik/tik_01/tik_01_3_drips.c @@ -1,5 +1,6 @@ #include "tik_01.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_02/tik_02_4_drips.c b/src/world/area_tik/tik_02/tik_02_4_drips.c index f154c40556..1577fac200 100644 --- a/src/world/area_tik/tik_02/tik_02_4_drips.c +++ b/src/world/area_tik/tik_02/tik_02_4_drips.c @@ -1,5 +1,6 @@ #include "tik_02.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_03/tik_03_3_drips.c b/src/world/area_tik/tik_03/tik_03_3_drips.c index bc4302296d..222f2f519c 100644 --- a/src/world/area_tik/tik_03/tik_03_3_drips.c +++ b/src/world/area_tik/tik_03/tik_03_3_drips.c @@ -1,5 +1,6 @@ #include "tik_03.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_04/tik_04_3_drips.c b/src/world/area_tik/tik_04/tik_04_3_drips.c index b05e48bb2f..48d0518959 100644 --- a/src/world/area_tik/tik_04/tik_04_3_drips.c +++ b/src/world/area_tik/tik_04/tik_04_3_drips.c @@ -1,5 +1,6 @@ #include "tik_04.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_05/tik_05_3_drips.c b/src/world/area_tik/tik_05/tik_05_3_drips.c index 2bba01fbc1..a37e5db900 100644 --- a/src/world/area_tik/tik_05/tik_05_3_drips.c +++ b/src/world/area_tik/tik_05/tik_05_3_drips.c @@ -1,5 +1,6 @@ #include "tik_05.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_06/tik_06_3_drips.c b/src/world/area_tik/tik_06/tik_06_3_drips.c index 7939d33565..2621592745 100644 --- a/src/world/area_tik/tik_06/tik_06_3_drips.c +++ b/src/world/area_tik/tik_06/tik_06_3_drips.c @@ -1,5 +1,6 @@ #include "tik_06.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_07/tik_07_4_drips.c b/src/world/area_tik/tik_07/tik_07_4_drips.c index 91d73e793a..a964d2ba36 100644 --- a/src/world/area_tik/tik_07/tik_07_4_drips.c +++ b/src/world/area_tik/tik_07/tik_07_4_drips.c @@ -1,5 +1,6 @@ #include "tik_07.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_08/tik_08_3_drips.c b/src/world/area_tik/tik_08/tik_08_3_drips.c index 1d59abd783..9e66a47054 100644 --- a/src/world/area_tik/tik_08/tik_08_3_drips.c +++ b/src/world/area_tik/tik_08/tik_08_3_drips.c @@ -1,5 +1,6 @@ #include "tik_08.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_09/tik_09_3_drips.c b/src/world/area_tik/tik_09/tik_09_3_drips.c index 66d45daf93..2d38564d59 100644 --- a/src/world/area_tik/tik_09/tik_09_3_drips.c +++ b/src/world/area_tik/tik_09/tik_09_3_drips.c @@ -1,5 +1,6 @@ #include "tik_09.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_10/tik_10_3_drips.c b/src/world/area_tik/tik_10/tik_10_3_drips.c index cb3adf0523..2e72d6afe9 100644 --- a/src/world/area_tik/tik_10/tik_10_3_drips.c +++ b/src/world/area_tik/tik_10/tik_10_3_drips.c @@ -1,5 +1,6 @@ #include "tik_10.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_12/tik_12_3_drips.c b/src/world/area_tik/tik_12/tik_12_3_drips.c index ba84303132..8dd0bc051f 100644 --- a/src/world/area_tik/tik_12/tik_12_3_drips.c +++ b/src/world/area_tik/tik_12/tik_12_3_drips.c @@ -1,5 +1,6 @@ #include "tik_12.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_14/tik_14_3_drips.c b/src/world/area_tik/tik_14/tik_14_3_drips.c index f44534b195..b6c104c2f8 100644 --- a/src/world/area_tik/tik_14/tik_14_3_drips.c +++ b/src/world/area_tik/tik_14/tik_14_3_drips.c @@ -1,5 +1,6 @@ #include "tik_14.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_15/tik_15_4_drips.c b/src/world/area_tik/tik_15/tik_15_4_drips.c index e30c470902..e1492f33ad 100644 --- a/src/world/area_tik/tik_15/tik_15_4_drips.c +++ b/src/world/area_tik/tik_15/tik_15_4_drips.c @@ -1,5 +1,6 @@ #include "tik_15.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_18/tik_18_3_drips.c b/src/world/area_tik/tik_18/tik_18_3_drips.c index d6f9e15320..1a36efccd8 100644 --- a/src/world/area_tik/tik_18/tik_18_3_drips.c +++ b/src/world/area_tik/tik_18/tik_18_3_drips.c @@ -1,5 +1,6 @@ #include "tik_18.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_20/tik_20_2_main.c b/src/world/area_tik/tik_20/tik_20_2_main.c index c18a7c4807..8cf4552cb1 100644 --- a/src/world/area_tik/tik_20/tik_20_2_main.c +++ b/src/world/area_tik/tik_20/tik_20_2_main.c @@ -30,6 +30,7 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = -1 } }; +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_21/tik_21_2_main.c b/src/world/area_tik/tik_21/tik_21_2_main.c index 9925e1b352..3de75502bc 100644 --- a/src/world/area_tik/tik_21/tik_21_2_main.c +++ b/src/world/area_tik/tik_21/tik_21_2_main.c @@ -70,6 +70,7 @@ EvtScript N(EVS_EnterMap) = { EVT_END }; +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_22/tik_22_2_main.c b/src/world/area_tik/tik_22/tik_22_2_main.c index a8cf2c3e68..d41eddeaf1 100644 --- a/src/world/area_tik/tik_22/tik_22_2_main.c +++ b/src/world/area_tik/tik_22/tik_22_2_main.c @@ -57,6 +57,7 @@ EvtScript N(EVS_EnterMap) = { EVT_END }; +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_23/tik_23_2_main.c b/src/world/area_tik/tik_23/tik_23_2_main.c index 17b5781118..cd7afbd55d 100644 --- a/src/world/area_tik/tik_23/tik_23_2_main.c +++ b/src/world/area_tik/tik_23/tik_23_2_main.c @@ -22,6 +22,7 @@ EvtScript N(EVS_BindExitTriggers) = { EVT_END }; +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_24/tik_24_3_drips.c b/src/world/area_tik/tik_24/tik_24_3_drips.c index c00bf6a861..5a10c3b102 100644 --- a/src/world/area_tik/tik_24/tik_24_3_drips.c +++ b/src/world/area_tik/tik_24/tik_24_3_drips.c @@ -1,5 +1,6 @@ #include "tik_24.h" +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/area_tik/tik_25/tik_25_2_main.c b/src/world/area_tik/tik_25/tik_25_2_main.c index 0ab5b2ba84..be9831a902 100644 --- a/src/world/area_tik/tik_25/tik_25_2_main.c +++ b/src/world/area_tik/tik_25/tik_25_2_main.c @@ -10,6 +10,7 @@ EvtScript N(EVS_BindExitTriggers) = { EVT_END }; +#define DROPLET_MODEL MODEL_sizuku #include "../common/DripVolumes.inc.c" DripVolumeList N(DripVolumes) = { diff --git a/src/world/common/enemy/Bandit.h b/src/world/common/enemy/Bandit.h index 1773f9fda6..a4e9d15f4a 100644 --- a/src/world/common/enemy/Bandit.h +++ b/src/world/common/enemy/Bandit.h @@ -16,20 +16,20 @@ #define BANDIT_ANIMS \ { \ - .idle = ANIM_Bandit_Anim01, \ - .walk = ANIM_Bandit_Anim05, \ - .run = ANIM_Bandit_Anim07, \ - .chase = ANIM_Bandit_Anim07, \ - .anim_4 = ANIM_Bandit_Anim01, \ - .anim_5 = ANIM_Bandit_Anim01, \ - .death = ANIM_Bandit_Anim09, \ - .hit = ANIM_Bandit_Anim09, \ - .anim_8 = ANIM_Bandit_Anim00, \ - .anim_9 = ANIM_Bandit_Anim00, \ - .anim_A = ANIM_Bandit_Anim00, \ - .anim_B = ANIM_Bandit_Anim00, \ - .anim_C = ANIM_Bandit_Anim00, \ - .anim_D = ANIM_Bandit_Anim00, \ - .anim_E = ANIM_Bandit_Anim00, \ - .anim_F = ANIM_Bandit_Anim00, \ + .idle = ANIM_Bandit_Idle, \ + .walk = ANIM_Bandit_Walk, \ + .run = ANIM_Bandit_Run, \ + .chase = ANIM_Bandit_Run, \ + .anim_4 = ANIM_Bandit_Idle, \ + .anim_5 = ANIM_Bandit_Idle, \ + .death = ANIM_Bandit_Hurt, \ + .hit = ANIM_Bandit_Hurt, \ + .anim_8 = ANIM_Bandit_Still, \ + .anim_9 = ANIM_Bandit_Still, \ + .anim_A = ANIM_Bandit_Still, \ + .anim_B = ANIM_Bandit_Still, \ + .anim_C = ANIM_Bandit_Still, \ + .anim_D = ANIM_Bandit_Still, \ + .anim_E = ANIM_Bandit_Still, \ + .anim_F = ANIM_Bandit_Still, \ } diff --git a/src/world/common/enemy/Bandit.inc.c b/src/world/common/enemy/Bandit.inc.c index b97ff3ed19..9f099b2690 100644 --- a/src/world/common/enemy/Bandit.inc.c +++ b/src/world/common/enemy/Bandit.inc.c @@ -82,7 +82,7 @@ EvtScript N(EVS_NpcDefeat_Bandit) = { EVT_CALL(DisablePlayerInput, TRUE) EVT_SET(HAS_COIN_FLAG, TRUE) EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_IGNORE_WORLD_COLLISION, TRUE) - EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Bandit_Anim02) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Bandit_IdleHolding) EVT_CALL(GetSelfNpcID, LVar0) EVT_EXEC(N(EVS_Bandit_CreateStolenCoin)) EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(1.0)) @@ -94,7 +94,7 @@ EvtScript N(EVS_NpcDefeat_Bandit) = { EVT_CALL(GetNpcYaw, NPC_SELF, LVar0) EVT_ADD(LVar0, 180) EVT_CALL(InterpNpcYaw, NPC_SELF, LVar0, 5) - EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Bandit_Anim08) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Bandit_RunHolding) EVT_WAIT(10) EVT_CALL(SetNpcSpeed, NPC_SELF, EVT_FLOAT(16.0)) EVT_ADD(LVar7, 200) diff --git a/src/world/common/enemy/Pokey.h b/src/world/common/enemy/Pokey.h index 4ea4e527b0..53b020e570 100644 --- a/src/world/common/enemy/Pokey.h +++ b/src/world/common/enemy/Pokey.h @@ -17,20 +17,20 @@ #define POKEY_ANIMS \ { \ - .idle = ANIM_Pokey_Anim04, \ - .walk = ANIM_Pokey_Anim08, \ - .run = ANIM_Pokey_Anim08, \ - .chase = ANIM_Pokey_Anim08, \ - .anim_4 = ANIM_Pokey_Anim04, \ - .anim_5 = ANIM_Pokey_Anim04, \ - .death = ANIM_Pokey_Anim0C, \ - .hit = ANIM_Pokey_Anim0C, \ - .anim_8 = ANIM_Pokey_Anim08, \ - .anim_9 = ANIM_Pokey_Anim08, \ - .anim_A = ANIM_Pokey_Anim08, \ - .anim_B = ANIM_Pokey_Anim08, \ - .anim_C = ANIM_Pokey_Anim08, \ - .anim_D = ANIM_Pokey_Anim08, \ - .anim_E = ANIM_Pokey_Anim08, \ - .anim_F = ANIM_Pokey_Anim08, \ + .idle = ANIM_Pokey_Idle4, \ + .walk = ANIM_Pokey_Run4, \ + .run = ANIM_Pokey_Run4, \ + .chase = ANIM_Pokey_Run4, \ + .anim_4 = ANIM_Pokey_Idle4, \ + .anim_5 = ANIM_Pokey_Idle4, \ + .death = ANIM_Pokey_Hurt4, \ + .hit = ANIM_Pokey_Hurt4, \ + .anim_8 = ANIM_Pokey_Run4, \ + .anim_9 = ANIM_Pokey_Run4, \ + .anim_A = ANIM_Pokey_Run4, \ + .anim_B = ANIM_Pokey_Run4, \ + .anim_C = ANIM_Pokey_Run4, \ + .anim_D = ANIM_Pokey_Run4, \ + .anim_E = ANIM_Pokey_Run4, \ + .anim_F = ANIM_Pokey_Run4, \ } diff --git a/src/world/common/enemy/PokeyMummy.h b/src/world/common/enemy/PokeyMummy.h index 0fe7a31e58..682eecc2b5 100644 --- a/src/world/common/enemy/PokeyMummy.h +++ b/src/world/common/enemy/PokeyMummy.h @@ -16,20 +16,20 @@ #define POKEY_MUMMY_ANIMS \ { \ - .idle = ANIM_Pokey_Mummy_Anim04, \ - .walk = ANIM_Pokey_Mummy_Anim08, \ - .run = ANIM_Pokey_Mummy_Anim08, \ - .chase = ANIM_Pokey_Mummy_Anim08, \ - .anim_4 = ANIM_Pokey_Mummy_Anim04, \ - .anim_5 = ANIM_Pokey_Mummy_Anim04, \ - .death = ANIM_Pokey_Mummy_Anim0C, \ - .hit = ANIM_Pokey_Mummy_Anim0C, \ - .anim_8 = ANIM_Pokey_Mummy_Anim08, \ - .anim_9 = ANIM_Pokey_Mummy_Anim08, \ - .anim_A = ANIM_Pokey_Mummy_Anim08, \ - .anim_B = ANIM_Pokey_Mummy_Anim08, \ - .anim_C = ANIM_Pokey_Mummy_Anim08, \ - .anim_D = ANIM_Pokey_Mummy_Anim08, \ - .anim_E = ANIM_Pokey_Mummy_Anim08, \ - .anim_F = ANIM_Pokey_Mummy_Anim08, \ + .idle = ANIM_Pokey_Mummy_Idle4, \ + .walk = ANIM_Pokey_Mummy_Run4, \ + .run = ANIM_Pokey_Mummy_Run4, \ + .chase = ANIM_Pokey_Mummy_Run4, \ + .anim_4 = ANIM_Pokey_Mummy_Idle4, \ + .anim_5 = ANIM_Pokey_Mummy_Idle4, \ + .death = ANIM_Pokey_Mummy_Hurt4, \ + .hit = ANIM_Pokey_Mummy_Hurt4, \ + .anim_8 = ANIM_Pokey_Mummy_Run4, \ + .anim_9 = ANIM_Pokey_Mummy_Run4, \ + .anim_A = ANIM_Pokey_Mummy_Run4, \ + .anim_B = ANIM_Pokey_Mummy_Run4, \ + .anim_C = ANIM_Pokey_Mummy_Run4, \ + .anim_D = ANIM_Pokey_Mummy_Run4, \ + .anim_E = ANIM_Pokey_Mummy_Run4, \ + .anim_F = ANIM_Pokey_Mummy_Run4, \ } diff --git a/src/world/common/todo/CheckDripCollisionWithNPC.inc.c b/src/world/common/todo/CheckDripCollisionWithNPC.inc.c deleted file mode 100644 index 4f51bf029e..0000000000 --- a/src/world/common/todo/CheckDripCollisionWithNPC.inc.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "common.h" -#include "npc.h" -#include "model.h" - -API_CALLABLE(N(CheckDripCollisionWithNPC)) { - PlayerStatus* playerStatus = &gPlayerStatus; - Bytecode* args = script->ptrReadPos; - s32 treeIndex = evt_get_variable(script, *args++); - Npc* partner = get_npc_unsafe(NPC_PARTNER); - Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex)); - f32 xDiff, zDiff, yVal; - f32 sqrtTemp; - s32 i; - - script->varTable[2] = 0; - xDiff = playerStatus->position.x - model->center.x; - zDiff = playerStatus->position.z - model->center.z; - yVal = playerStatus->position.y + playerStatus->colliderHeight - 1.5f - model->center.y; - sqrtTemp = sqrtf(SQ(xDiff) + SQ(zDiff)); - - if (yVal > 0.0f && yVal < playerStatus->colliderHeight && sqrtTemp < playerStatus->colliderDiameter * 0.5f) { - script->varTable[2] = 1; - } - - xDiff = partner->pos.x - model->center.x; - zDiff = partner->pos.z - model->center.z; - yVal = partner->pos.y + partner->collisionHeight - 1.5f - model->center.y; - sqrtTemp = sqrtf(SQ(xDiff) + SQ(zDiff)); - - if (yVal > 0.0f && yVal < partner->collisionHeight && sqrtTemp < partner->collisionDiameter * 0.5f) { - script->varTable[2] = 1; - } - - for (i = 0; i < MAX_NPCS; i++) { - Npc* npc = get_npc_safe(i); - - if (npc != NULL) { - xDiff = npc->pos.x - model->center.x; - zDiff = npc->pos.z - model->center.z; - yVal = npc->pos.y + npc->collisionHeight - 1.5f - model->center.y; - sqrtTemp = sqrtf(SQ(xDiff) + SQ(zDiff)); - - if (yVal > 0.0f && yVal < npc->collisionHeight && sqrtTemp < npc->collisionDiameter * 0.5f) { - script->varTable[2] = 1; - break; - } - } - } - return ApiStatus_DONE2; -} diff --git a/src/world/common/todo/UnkFunc52.inc.c b/src/world/common/todo/UnkFunc52.inc.c index bef2b94360..2a3b78304b 100644 --- a/src/world/common/todo/UnkFunc52.inc.c +++ b/src/world/common/todo/UnkFunc52.inc.c @@ -1,4 +1,3 @@ -#include "common.h" #include "battle/battle.h" API_CALLABLE(N(UnkFunc52)) { diff --git a/src/world/common/todo/UnkFunc56.inc.c b/src/world/common/todo/UnkFunc56.inc.c deleted file mode 100644 index 14f637d6b0..0000000000 --- a/src/world/common/todo/UnkFunc56.inc.c +++ /dev/null @@ -1,74 +0,0 @@ -#include "common.h" -#include "model.h" - -API_CALLABLE(N(UnkFunc56)) { - BattleStatus* battleStatus = &gBattleStatus; - Bytecode* args = script->ptrReadPos; - Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(evt_get_variable(script, *args++))); - f32 xDiff, yDiff, zDiff, temp; - Actor* actor; - s32 i; - - script->varTable[2] = 0; - - actor = battleStatus->playerActor; - if (actor != NULL) { - xDiff = actor->currentPos.x - model->center.x; - yDiff = actor->currentPos.y + actor->size.y - 1.5f - model->center.y; - zDiff = actor->currentPos.z - model->center.z; - temp = sqrtf(SQ(xDiff) + SQ(zDiff)); - - if (yDiff > 0.0f && yDiff < actor->size.y && temp < actor->size.x * 0.5f) { - script->varTable[2] = 1; - return ApiStatus_DONE2; - } - } - - actor = battleStatus->partnerActor; - if (actor != NULL) { - xDiff = actor->currentPos.x - model->center.x; - yDiff = actor->currentPos.y + actor->size.y - 1.5f - model->center.y; - zDiff = actor->currentPos.z - model->center.z; - temp = sqrtf(SQ(xDiff) + SQ(zDiff)); - - if (yDiff > 0.0f && yDiff < actor->size.y && temp < actor->size.x * 0.5f) { - script->varTable[2] = 1; - return ApiStatus_DONE2; - } - } - - for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { - ActorPart* part; - - actor = battleStatus->enemyActors[i]; - - if (actor != NULL && !(actor->flags & ACTOR_FLAG_DISABLED)) { - xDiff = actor->currentPos.x - model->center.x; - yDiff = actor->currentPos.y + actor->size.y - 1.5f - model->center.y; - zDiff = actor->currentPos.z - model->center.z; - temp = sqrtf(SQ(xDiff) + SQ(zDiff)); - - if (yDiff > 0.0f && yDiff < actor->size.y && temp < actor->size.x * 0.5f) { - script->varTable[2] = 1; - return ApiStatus_DONE2; - } - - for (part = actor->partsTable; part != NULL; part = part->nextPart) { - if (!(part->flags & ACTOR_PART_FLAG_INVISIBLE)) { - if (part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) { - xDiff = part->currentPos.x - model->center.x; - yDiff = part->currentPos.y + part->size.y - 1.5f - model->center.y; - zDiff = part->currentPos.z - model->center.z; - temp = sqrtf(SQ(xDiff) + SQ(zDiff)); - - if (yDiff > 0.0f && yDiff < part->size.y && temp < part->size.x * 0.5f) { - script->varTable[2] = 1; - return ApiStatus_DONE2; - } - } - } - } - } - } - return ApiStatus_DONE2; -} diff --git a/tools/splat_ext/npc.yaml b/tools/splat_ext/npc.yaml index b8a873fd3e..e2ffb29558 100644 --- a/tools/splat_ext/npc.yaml +++ b/tools/splat_ext/npc.yaml @@ -2752,18 +2752,18 @@ Pokey: - Variant01 - Variant02 frames: - - Raster00 - - Raster01 - - Raster02 - - Raster03 - - Raster04 - - Raster05 - - Raster06 - - Raster07 - - Raster08 - - Raster09 - - Raster0A - - Raster0B + - Head + - Body + - Angry + - Idle1 + - Idle2 + - Hurt1 + - Hurt2 + - BurnedHurt1 + - BurnedHurt2 + - BurnedBody + - BurnedHead + - Sleep palettes: - Default - Mummy @@ -2779,94 +2779,94 @@ Pokey: - Frost_Shocked - Burnt animations: - - Anim00 - - Anim01 - - Anim02 - - Anim03 - - Anim04 - - Anim05 - - Anim06 - - Anim07 - - Anim08 - - Anim09 - - Anim0A - - Anim0B - - Anim0C - - Anim0D - - Anim0E - - Anim0F - - Anim10 - - Anim11 - - Anim12 - - Anim13 - - Anim14 - - Anim15 - - Anim16 - - Anim17 - - Anim18 - - Anim19 - - Anim1A - - Anim1B - - Anim1C - - Anim1D - - Anim1E - - Anim1F - - Anim20 - - Anim21 - - Anim22 - - Anim23 - - Anim24 - - Anim25 - - Anim26 - - Anim27 - - Anim28 + - Still4 + - Still3 + - Still2 + - Still1 + - Idle4 + - Idle3 + - Idle2 + - Idle1 + - Run4 + - Run3 + - Run2 + - Run1 + - Hurt4 + - Hurt3 + - Hurt2 + - Hurt1 + - Windup3 + - Throw3 + - Windup2 + - Throw2 + - Windup1 + - Throw1 + - Projectile + - Emerge + - BurnHurt4 + - BurnStill4 + - BurnHurt3 + - BurnStill3 + - BurnHurt2 + - BurnStill2 + - BurnHurt1 + - BurnStill1 + - BurnedProjectile + - Dizzy4 + - Dizzy3 + - Dizzy2 + - Dizzy1 + - Sleep4 + - Sleep3 + - Sleep2 + - Sleep1 Bandit: frames: - - Raster00 - - Raster01 - - Raster02 - - Raster03 - - Raster04 - - Raster05 - - Raster06 - - Raster07 - - Raster08 - - Raster09 - - Raster0A - - Raster0B - - Raster0C - - Raster0D - - Raster0E - - Raster0F - - Raster10 - - Raster11 - - Raster12 - - Raster13 - - Raster14 - - Raster15 - - Raster16 - - Raster17 - - Raster18 - - Raster19 - - Raster1A - - Raster1B - - Raster1C - - Raster1D - - Raster1E - - Raster1F - - Raster20 - - Raster21 - - Raster22 - - Raster23 - - Raster24 - - Raster25 - - Raster26 - - Raster27 - - Raster28 - - Raster29 - - Raster2A - - Raster2B - - Raster2C + - Step1 + - Step2 + - Step3 + - Neutral + - StepHolding1 + - StepHolding2 + - StepHolding3 + - NeutralHolding + - LookUp + - GrinHolding + - Tackle + - Hurt1 + - Idle1 + - Idle2 + - IdleHolding1 + - IdleHolding2 + - Hurt2 + - BurnHurt1 + - BurnHurt2 + - BurnStill + - Sleep + - Dizzy1 + - Dizzy2 + - Dizzy3 + - Dizzy4 + - Laugh1 + - Laugh2 + - Relief1 + - Relief2 + - Coin01 + - Coin02 + - Coin03 + - Coin04 + - Coin05 + - Coin06 + - Coin07 + - Coin08 + - Coin09 + - Coin10 + - Poof1 + - Poof2 + - Poof3 + - Poof4 + - Poof5 + - Poof6 palettes: - Default - Poisoned @@ -2875,27 +2875,27 @@ Bandit: - Burnt - Coin animations: - - Anim00 - - Anim01 - - Anim02 - - Anim03 - - Anim04 - - Anim05 - - Anim06 - - Anim07 - - Anim08 - - Anim09 - - Anim0A - - Anim0B - - Anim0C - - Anim0D - - Anim0E - - Anim0F - - Anim10 - - Anim11 - - Anim12 - - Anim13 - - Anim14 + - Still + - Idle + - IdleHolding + - StillUnused + - StillHolding + - Walk + - WalkHolding + - Run + - RunHolding + - Hurt + - BurnHurt + - BurnStill + - Poof + - Tackle + - LookUp + - GotCoin + - Sleep + - Dizzy + - Laugh + - Relief + - Coin BuzzyBeetle: frames: - Raster00 diff --git a/ver/pal/splat.yaml b/ver/pal/splat.yaml index 71a2ba6e65..e8bd98726b 100644 --- a/ver/pal/splat.yaml +++ b/ver/pal/splat.yaml @@ -4720,9 +4720,9 @@ segments: subalign: 4 subsegments: - [0x49A190, c, area] - - [0x49A190, c, actor/spiked_goomba] - - [0x49A410, c, actor/paragoomba] - - [0x49A6F0, c, actor/paragoomba2] + - [0x49A190, c, actor/tutorial_spiked_goomba] + - [0x49A410, c, actor/tutorial_paragoomba] + - [0x49A6F0, c, actor/paragoomba] - [0x49A9D0, c, actor/jr_troopa] - [0x49A9D0, c, actor/egg_jr_troopa] - [0x49A9D0, c, actor/para_jr_troopa] @@ -4732,13 +4732,13 @@ segments: - [0x49B170, c, stage/kmr_02] - [0x49B170, c, stage/kmr_03] - [0x49B3E0, c, stage/kmr_04] - - [0x49B650, c, stage/kmr_05] + - [0x49B650, c, stage/kmr_05b] - [0x49B8C0, c, stage/kmr_06] - [0x49BB70, c, stage/nok_01] - [0x49BB70, c, stage/mim_01] - [0x49BBD0, c, stage/sam_01] - [0x49BEF0, c, stage/mac_01] - - [0x49C340, c, stage/kpa_01] + - [0x49C340, c, stage/kpa_13] - [0x49C340] - dir: battle/area/mac type: code @@ -4932,7 +4932,7 @@ segments: start: 0x5517A0 vram: 0x80218000 subsegments: - - [0x5517A0, c, actor/hypergoomba] + - [0x5517A0, c, actor/hyper_goomba] - [0x551A80, c, actor/hyper_paragoomba] - [0x551D60, c, actor/hyper_cleft] - [0x551E20, c, actor/tubbas_heart] @@ -5449,8 +5449,8 @@ segments: - [0x6F4350, c, actor/bowser_phase_2] - [0x6F59E0, c, actor/bowser_phase_3] - [0x6F7320, c, stage/kpa_01] - - [0x6F7320, c, stage/kpa_02] - - [0x6F7320, c, stage/kpa_03] + - [0x6F7320, c, stage/kkj_01] + - [0x6F7320, c, stage/kkj_02] - [0x6F7370, c, area] - [0x6F7370] - dir: battle/area/kpa3 diff --git a/ver/pal/undefined_syms.txt b/ver/pal/undefined_syms.txt index 18310c26b5..e7c3d12dab 100644 --- a/ver/pal/undefined_syms.txt +++ b/ver/pal/undefined_syms.txt @@ -803,7 +803,7 @@ SetProjectileTargetOffset = 0x8027D8B8; EnableActorBlur = 0x8027D96C; AfflictActor = 0x8027DA6C; GetInstigatorValue = 0x8027DB4C; -GetEncounterState = 0x8027DBB4; +GetEncounterTrigger = 0x8027DBB4; YieldTurn = 0x8027DBE0; SetActorSize = 0x8027DC00; GetActorSize = 0x8027DCD0; diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index 1c8a1ed3ac..19762f744e 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -7249,9 +7249,9 @@ segments: subalign: 4 subsegments: - [0x447440, c, area] - - [0x447440, c, actor/spiked_goomba] - - [0x4476C0, c, actor/paragoomba] - - [0x4479A0, c, actor/paragoomba2] + - [0x447440, c, actor/tutorial_spiked_goomba] + - [0x4476C0, c, actor/tutorial_paragoomba] + - [0x4479A0, c, actor/paragoomba] - [0x447C80, c, actor/jr_troopa] - [0x447C80, c, actor/egg_jr_troopa] - [0x447C80, c, actor/para_jr_troopa] @@ -7261,13 +7261,13 @@ segments: - [0x448420, c, stage/kmr_02] - [0x448420, c, stage/kmr_03] - [0x448690, c, stage/kmr_04] - - [0x448900, c, stage/kmr_05] + - [0x448900, c, stage/kmr_05b] - [0x448B70, c, stage/kmr_06] - [0x448E20, c, stage/nok_01] - [0x448E20, c, stage/mim_01] - [0x448E80, c, stage/sam_01] - [0x4491A0, c, stage/mac_01] - - [0x4495F0, c, stage/kpa_01] + - [0x4495F0, c, stage/kpa_13] - [0x4495F0] - dir: battle/area/mac type: code @@ -7475,7 +7475,7 @@ segments: vram: 0x80218000 follows_vram: heaps subsegments: - - [0x4FEA50, c, actor/hypergoomba] + - [0x4FEA50, c, actor/hyper_goomba] - [0x4FED30, c, actor/hyper_paragoomba] - [0x4FF010, c, actor/hyper_cleft] - [0x4FF0D0, c, actor/tubbas_heart] @@ -8010,8 +8010,8 @@ segments: - [0x6A14C0, c, actor/bowser_phase_2] - [0x6A2B50, c, actor/bowser_phase_3] - [0x6A4490, c, stage/kpa_01] - - [0x6A4490, c, stage/kpa_02] - - [0x6A4490, c, stage/kpa_03] + - [0x6A4490, c, stage/kkj_01] + - [0x6A4490, c, stage/kkj_02] - [0x6A44E0, c, area] - [0x6A44E0] - dir: battle/area/kpa3 diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index 81dec756da..9cb1804415 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -7196,7 +7196,7 @@ EnableActorBlur = 0x8027D57C; // type:func rom:0x1ABE5C func_8027D628 = 0x8027D628; // type:func rom:0x1ABF08 AfflictActor = 0x8027D67C; // type:func rom:0x1ABF5C GetInstigatorValue = 0x8027D75C; // type:func rom:0x1AC03C -GetEncounterState = 0x8027D7C4; // type:func rom:0x1AC0A4 +GetEncounterTrigger = 0x8027D7C4; // type:func rom:0x1AC0A4 YieldTurn = 0x8027D7F0; // type:func rom:0x1AC0D0 SetActorSize = 0x8027D810; // type:func rom:0x1AC0F0 GetActorSize = 0x8027D8E0; // type:func rom:0x1AC1C0 @@ -9361,7 +9361,7 @@ b_area_kmr_part_1_kmr_03_InterpCloudTransform = 0x802187E0; // type:func rom:0x4 b_area_kmr_part_1_kmr_04_InterpCloudTransform = 0x80218A50; // type:func rom:0x4313F0 b_area_kmr_part_1_kmr_05_InterpCloudTransform = 0x80218CC0; // type:func rom:0x431660 b_area_kmr_part_1_kmr_06_InterpCloudTransform = 0x80218F30; // type:func rom:0x4318D0 -b_area_kmr_part_1_kmr_06_UnkFogFunc = 0x80219198; // type:func rom:0x431B38 +b_area_kmr_part_1_kmr_06_SetupFog = 0x80219198; // type:func rom:0x431B38 b_area_kmr_part_1_Formation_00 = 0x802191E0; // type:data rom:0x431B80 b_area_kmr_part_1_Formation_01 = 0x802191FC; // type:data rom:0x431B9C b_area_kmr_part_1_Formation_02 = 0x80219234; // type:data rom:0x431BD4 @@ -9469,7 +9469,7 @@ b_area_kmr_part_2_kmr_03_InterpCloudTransform = 0x80218D50; // type:func rom:0x4 b_area_kmr_part_2_kmr_04_InterpCloudTransform = 0x80218FC0; // type:func rom:0x43AA50 b_area_kmr_part_2_kmr_05_InterpCloudTransform = 0x80219230; // type:func rom:0x43ACC0 b_area_kmr_part_2_kmr_06_InterpCloudTransform = 0x802194A0; // type:func rom:0x43AF30 -b_area_kmr_part_2_kmr_06_UnkFogFunc = 0x80219708; // type:func rom:0x43B198 +b_area_kmr_part_2_kmr_06_SetupFog = 0x80219708; // type:func rom:0x43B198 b_area_kmr_part_2_pos00 = 0x80219750; // type:data rom:0x43B1E0 b_area_kmr_part_2_pos01 = 0x8021975C; // type:data rom:0x43B1EC b_area_kmr_part_2_Formation_00 = 0x80219768; // type:data rom:0x43B1F8 @@ -9619,8 +9619,8 @@ b_area_kmr_part_3_kmr_03_InterpCloudTransform = 0x80218FE0; // type:func rom:0x4 b_area_kmr_part_3_kmr_04_InterpCloudTransform = 0x80219250; // type:func rom:0x448690 b_area_kmr_part_3_kmr_05_InterpCloudTransform = 0x802194C0; // type:func rom:0x448900 b_area_kmr_part_3_kmr_06_InterpCloudTransform = 0x80219730; // type:func rom:0x448B70 -b_area_kmr_part_3_kmr_06_UnkFogFunc = 0x80219998; // type:func rom:0x448DD8 -b_area_kmr_part_3_mim_01_UnkFogFunc2 = 0x802199E0; // type:func rom:0x448E20 +b_area_kmr_part_3_kmr_06_SetupFog = 0x80219998; // type:func rom:0x448DD8 +b_area_kmr_part_3_mim_01_SetupFog = 0x802199E0; // type:func rom:0x448E20 b_area_kmr_part_3_sam_01_UnkModelStuff_func1 = 0x80219A40; // type:func rom:0x448E80 b_area_kmr_part_3_sam_01_Set80071270_0_16 = 0x80219C38; // type:func rom:0x449078 b_area_kmr_part_3_sam_01_UnkFloatFunc2 = 0x80219C5C; // type:func rom:0x44909C @@ -11026,7 +11026,7 @@ b_area_sbk_bandit_idle_8021D810 = 0x8021D810; // type:data rom:0x4DFDF0 b_area_sbk_bandit_8021D820 = 0x8021D820; // type:data rom:0x4DFE00 b_area_sbk_bandit_handleEvent_8021DF88 = 0x8021DF88; // type:data rom:0x4E0568 b_area_sbk_bandit_takeTurn_8021E900 = 0x8021E900; // type:data rom:0x4E0EE0 -b_area_sbk_sbk_02_8021F720 = 0x8021F720; // type:data rom:0x4E1D00 +b_area_sbk_sbk_02_EVS_UpdateSunPos = 0x8021F720; // type:data rom:0x4E1D00 b_area_sbk_sbk_02_EVS_PreBattle = 0x8021F800; // type:data rom:0x4E1DE0 b_area_sbk_sbk_02_EVS_PostBattle = 0x8021F8E8; // type:data rom:0x4E1EC8 b_area_sbk_sbk_02_ForegroundModels = 0x8021F8F8; // type:data rom:0x4E1ED8 @@ -11347,7 +11347,7 @@ D_80220780 = 0x80220780; // type:data rom:0x4F7C20 b_area_mim_forest_fuzzy_SpawnDrainHealthContinueFX = 0x802180B4; // type:func rom:0x4F7C94 b_area_mim_bzzap_SetAbsoluteStatusOffsets = 0x80218170; // type:func rom:0x4F7D50 b_area_mim_bzzap_UnkFloatFunc4 = 0x8021823C; // type:func rom:0x4F7E1C -b_area_mim_mim_01_UnkFogFunc2 = 0x80218360; // type:func rom:0x4F7F40 +b_area_mim_mim_01_SetupFog = 0x80218360; // type:func rom:0x4F7F40 b_area_mim_forest_fuzzy_DefenseTable_802183C0 = 0x802183C0; // type:data rom:0x4F7FA0 b_area_mim_forest_fuzzy_StatusTable_802183CC = 0x802183CC; // type:data rom:0x4F7FAC b_area_mim_forest_fuzzy_ActorParts = 0x80218478; // type:data rom:0x4F8058 @@ -11411,31 +11411,31 @@ b_area_mim_Formation_10 = 0x8021E9E4; // type:data rom:0x4FE5C4 b_area_mim_Formation_11 = 0x8021EA1C; // type:data rom:0x4FE5FC b_area_mim_Formations = 0x8021EA70; // type:data rom:0x4FE650 b_area_mim_Stages = 0x8021EBEC; // type:data rom:0x4FE7CC -b_area_arn_hypergoomba_StartRumbleWithParams = 0x80218000; // type:func rom:0x4FEA50 -b_area_arn_hypergoomba_ArcsinDeg = 0x80218058; // type:func rom:0x4FEAA8 -b_area_arn_hypergoomba_CalculateRotationZ = 0x802181E4; // type:func rom:0x4FEC34 +b_area_arn_hyper_goomba_StartRumbleWithParams = 0x80218000; // type:func rom:0x4FEA50 +b_area_arn_hyper_goomba_ArcsinDeg = 0x80218058; // type:func rom:0x4FEAA8 +b_area_arn_hyper_goomba_CalculateRotationZ = 0x802181E4; // type:func rom:0x4FEC34 b_area_arn_hyper_paragoomba_StartRumbleWithParams = 0x802182E0; // type:func rom:0x4FED30 b_area_arn_hyper_paragoomba_ArcsinDeg = 0x80218338; // type:func rom:0x4FED88 b_area_arn_hyper_paragoomba_CalculateRotationZ = 0x802184C4; // type:func rom:0x4FEF14 b_area_arn_hyper_cleft_StartRumbleWithParams = 0x802185C0; // type:func rom:0x4FF010 b_area_arn_hyper_cleft_SetSpinSmashable = 0x80218618; // type:func rom:0x4FF068 b_area_arn_tubbas_heart_func_80218680_4FF0D0 = 0x80218680; // type:func rom:0x4FF0D0 -b_area_arn_hypergoomba_DefenseTable_80218770 = 0x80218770; // type:data rom:0x4FF1C0 -b_area_arn_hypergoomba_StatusTable_8021877C = 0x8021877C; // type:data rom:0x4FF1CC -b_area_arn_hypergoomba_ActorParts = 0x80218828; // type:data rom:0x4FF278 -b_area_arn_hypergoomba = 0x8021884C; // type:data rom:0x4FF29C -b_area_arn_hypergoomba_IdleAnimations_80218874 = 0x80218874; // type:data rom:0x4FF2C4 -b_area_arn_hypergoomba_init_802188C0 = 0x802188C0; // type:data rom:0x4FF310 -b_area_arn_hypergoomba_nextTurn_80218950 = 0x80218950; // type:data rom:0x4FF3A0 -b_area_arn_hypergoomba_802189D4 = 0x802189D4; // type:data rom:0x4FF424 -b_area_arn_hypergoomba_takeTurn_802195F0 = 0x802195F0; // type:data rom:0x500040 -b_area_arn_hypergoomba_IdleAnimations_80219818 = 0x80219818; // type:data rom:0x500268 -b_area_arn_hypergoomba_IdleAnimations_80219864 = 0x80219864; // type:data rom:0x5002B4 -b_area_arn_hypergoomba_802198B0 = 0x802198B0; // type:data rom:0x500300 -b_area_arn_hypergoomba_idle_802198FC = 0x802198FC; // type:data rom:0x50034C -b_area_arn_hypergoomba_handleEvent_80219BD8 = 0x80219BD8; // type:data rom:0x500628 -b_area_arn_hypergoomba_sinTable = 0x8021A4BC; // type:data rom:0x500F0C -b_area_arn_hypergoomba_takeTurn_8021A628 = 0x8021A628; // type:data rom:0x501078 +b_area_arn_hyper_goomba_DefenseTable_80218770 = 0x80218770; // type:data rom:0x4FF1C0 +b_area_arn_hyper_goomba_StatusTable_8021877C = 0x8021877C; // type:data rom:0x4FF1CC +b_area_arn_hyper_goomba_ActorParts = 0x80218828; // type:data rom:0x4FF278 +b_area_arn_hyper_goomba = 0x8021884C; // type:data rom:0x4FF29C +b_area_arn_hyper_goomba_IdleAnimations_80218874 = 0x80218874; // type:data rom:0x4FF2C4 +b_area_arn_hyper_goomba_init_802188C0 = 0x802188C0; // type:data rom:0x4FF310 +b_area_arn_hyper_goomba_nextTurn_80218950 = 0x80218950; // type:data rom:0x4FF3A0 +b_area_arn_hyper_goomba_802189D4 = 0x802189D4; // type:data rom:0x4FF424 +b_area_arn_hyper_goomba_takeTurn_802195F0 = 0x802195F0; // type:data rom:0x500040 +b_area_arn_hyper_goomba_IdleAnimations_80219818 = 0x80219818; // type:data rom:0x500268 +b_area_arn_hyper_goomba_IdleAnimations_80219864 = 0x80219864; // type:data rom:0x5002B4 +b_area_arn_hyper_goomba_802198B0 = 0x802198B0; // type:data rom:0x500300 +b_area_arn_hyper_goomba_idle_802198FC = 0x802198FC; // type:data rom:0x50034C +b_area_arn_hyper_goomba_handleEvent_80219BD8 = 0x80219BD8; // type:data rom:0x500628 +b_area_arn_hyper_goomba_sinTable = 0x8021A4BC; // type:data rom:0x500F0C +b_area_arn_hyper_goomba_takeTurn_8021A628 = 0x8021A628; // type:data rom:0x501078 b_area_arn_hyper_paragoomba_DefenseTable_8021B2F0 = 0x8021B2F0; // type:data rom:0x501D40 b_area_arn_hyper_paragoomba_DefenseTable_8021B2FC = 0x8021B2FC; // type:data rom:0x501D4C b_area_arn_hyper_paragoomba_StatusTable_8021B308 = 0x8021B308; // type:data rom:0x501D58 @@ -12715,9 +12715,9 @@ dup2_b_area_tik_ArcsinDeg = 0x80218758; // type:func rom:0x5ECBE8 dup2_b_area_tik_CalculateRotationZ = 0x802188E4; // type:func rom:0x5ECD74 dup2_b_area_tik_SetAbsoluteStatusOffsets = 0x802189E0; // type:func rom:0x5ECE70 dup3_b_area_tik_SetAbsoluteStatusOffsets = 0x80218AB0; // type:func rom:0x5ECF40 -dup_b_area_tik_UnkFunc56 = 0x80218B80; // type:func rom:0x5ED010 -b_area_tik_UnkFunc56 = 0x80219020; // type:func rom:0x5ED4B0 -dup2_b_area_tik_UnkFunc56 = 0x802194C0; // type:func rom:0x5ED950 +dup_b_area_tik_CheckDripCollisionWithActors = 0x80218B80; // type:func rom:0x5ED010 +b_area_tik_CheckDripCollisionWithActors = 0x80219020; // type:func rom:0x5ED4B0 +dup2_b_area_tik_CheckDripCollisionWithActors = 0x802194C0; // type:func rom:0x5ED950 func_80219960_5EDDF0 = 0x80219960; // type:func rom:0x5EDDF0 b_area_tik_UpdateTexturePanSmooth = 0x80219DB0; // type:func rom:0x5EE240 b_area_tik_UpdateTexturePanStepped = 0x80219ED4; // type:func rom:0x5EE364 @@ -12737,9 +12737,9 @@ dup2_b_area_tik2_SpitInk = 0x80218884; // type:func rom:0x609334 dup3_b_area_tik2_StartRumbleWithParams = 0x80218A20; // type:func rom:0x6094D0 b_area_tik2_SpawnDrainHealthStartFX = 0x80218A78; // type:func rom:0x609528 b_area_tik2_SpawnDrainHealthContinueFX = 0x80218B2C; // type:func rom:0x6095DC -b_area_tik2_UnkFunc56 = 0x80218BE0; // type:func rom:0x609690 -dup_b_area_tik2_UnkFunc56 = 0x80219080; // type:func rom:0x609B30 -dup2_b_area_tik2_UnkFunc56 = 0x80219520; // type:func rom:0x609FD0 +b_area_tik2_CheckDripCollisionWithActors = 0x80218BE0; // type:func rom:0x609690 +dup_b_area_tik2_CheckDripCollisionWithActors = 0x80219080; // type:func rom:0x609B30 +dup2_b_area_tik2_CheckDripCollisionWithActors = 0x80219520; // type:func rom:0x609FD0 func_802199C0_60A470 = 0x802199C0; // type:func rom:0x60A470 b_area_tik2_UpdateTexturePanSmooth = 0x80219E10; // type:func rom:0x60A8C0 b_area_tik2_UpdateTexturePanStepped = 0x80219F34; // type:func rom:0x60A9E4 @@ -12747,9 +12747,9 @@ b_area_tik3_SetAbsoluteStatusOffsets = 0x80218000; // type:func rom:0x6186F0 dup_b_area_tik3_SetAbsoluteStatusOffsets = 0x802180D0; // type:func rom:0x6187C0 b_area_tik3_SpawnDrainHealthStartFX = 0x8021819C; // type:func rom:0x61888C b_area_tik3_SpawnDrainHealthContinueFX = 0x80218250; // type:func rom:0x618940 -b_area_tik3_UnkFunc56 = 0x80218310; // type:func rom:0x618A00 -dup_b_area_tik3_UnkFunc56 = 0x802187B0; // type:func rom:0x618EA0 -dup2_b_area_tik3_UnkFunc56 = 0x80218C50; // type:func rom:0x619340 +b_area_tik3_CheckDripCollisionWithActors = 0x80218310; // type:func rom:0x618A00 +dup_b_area_tik3_CheckDripCollisionWithActors = 0x802187B0; // type:func rom:0x618EA0 +dup2_b_area_tik3_CheckDripCollisionWithActors = 0x80218C50; // type:func rom:0x619340 func_802190F0_6197E0 = 0x802190F0; // type:func rom:0x6197E0 b_area_tik3_UpdateTexturePanSmooth = 0x80219540; // type:func rom:0x619C30 b_area_tik3_UpdateTexturePanStepped = 0x80219664; // type:func rom:0x619D54 @@ -16270,7 +16270,7 @@ kmr_10_TransformFoliage = 0x80240440; // type:func rom:0x8D8910 kmr_10_varStash = 0x80240C20; // type:data rom:0x8D90F0 kmr_11_foliage_setup_shear_mtx = 0x80240000; // type:func rom:0x8DA100 kmr_11_TransformFoliage = 0x80240070; // type:func rom:0x8DA170 -kmr_11_UnkFogFunc = 0x8024023C; // type:func rom:0x8DA33C +kmr_11_SetupFog = 0x8024023C; // type:func rom:0x8DA33C UseSlowerFadeOnMapChange = 0x8024027C; // type:func rom:0x8DA37C MakeLensFlare = 0x802402A0; // type:func rom:0x8DA3A0 SetCameraVFov = 0x80240344; // type:func rom:0x8DA444 @@ -23952,7 +23952,7 @@ pra_01_EnablePartnerReflection = 0x80240D3C; // type:func rom:0xD4DD7C pra_01_worker_reflect_partner_all = 0x80240E84; // type:func rom:0xD4DEC4 pra_01_worker_reflect_partner_floor = 0x80240EB8; // type:func rom:0xD4DEF8 pra_01_worker_reflect_partner_wall = 0x80240EEC; // type:func rom:0xD4DF2C -pra_01_UnkFogFunc = 0x80240F20; // type:func rom:0xD4DF60 +pra_01_SetupFog = 0x80240F20; // type:func rom:0xD4DF60 func_80240F60_D4DFA0 = 0x80240F60; // type:func rom:0xD4DFA0 pra_01_GetNpcCollisionHeight = 0x80240F80; // type:func rom:0xD4DFC0 pra_01_AddPlayerHandsOffset = 0x80240FDC; // type:func rom:0xD4E01C