From d2875030a379cefc6574c1ca1ce9e8ab52916217 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 16 Jul 2021 13:22:21 +0100 Subject: [PATCH] Name files and avoid use of X32 type for functionTemp (#314) * name entity files * name encounter_api * abolish X32 --- include/common_structs.h | 2 +- src/107830_len_e70.c | 28 ---- src/1086a0_len_fc0.c | 37 ----- src/181810.c | 10 +- src/18F340.c | 54 +++---- src/19FAF0.c | 6 +- src/1a1f0_len_5390.c | 56 +++---- src/23680.c | 8 +- src/25AF0.c | 4 +- src/battle/area_trd_part_3/4CF1B0.c | 12 +- src/battle/item/dizzy_dial.c | 18 +-- src/battle/item/fire_flower.c | 8 +- src/battle/item/fright_jar.c | 8 +- src/battle/item/shooting_star.c | 16 +- src/battle/item/sleepy_sheep.c | 26 ++-- src/battle/item/snowman_doll.c | 8 +- src/battle/item/stone_cap.c | 12 +- src/battle/item/stop_watch.c | 8 +- src/battle/item/thunder_bolt.c | 8 +- src/battle/item/thunder_rage.c | 8 +- src/battle/move/mega_quake/756780.c | 14 +- src/battle/partner/goombario.c | 6 +- src/battle/star/lullaby/78D150.c | 20 +-- src/battle/star/peach_beam/7997B0.c | 8 +- src/battle/star/star_beam/796FC0.c | 8 +- src/common/FadeBackgroundToBlack.inc.c | 8 +- src/common/UnkBackgroundFunc.inc.c | 8 +- src/common/UnkBackgroundFunc2.inc.c | 8 +- src/{1f580_len_1940.c => encounter_api.c} | 20 +-- src/{104940_len_dc0.c => entity/Block.c} | 4 +- src/{10A230.c => entity/BlueWarpPipe.c} | 2 +- src/entity/Chest.c | 37 +++++ src/{105F90.c => entity/HeartBlock.c} | 10 +- src/{105700_len_2130.c => entity/ItemBlock.c} | 4 +- src/{102610_len_2330.c => entity/SaveBlock.c} | 2 +- src/{10A8D0.c => entity/Signpost.c} | 0 src/entity/SimpleSpring.c | 28 ++++ src/{106EF0.c => entity/SuperBlock.c} | 2 +- src/{102C80.c => entity/Switch.c} | 10 +- .../WoodenCrate.c} | 6 +- src/evt/f8f60_len_1560.c | 26 ++-- src/evt/fa4c0_len_3bf0.c | 10 +- src/evt/fx_api.c | 10 +- src/evt/msg_api.c | 4 +- src/evt/npc_api.c | 76 +++++----- src/evt/player_api.c | 78 +++++----- src/evt/si.c | 16 +- src/world/area_arn/arn_02/events.c | 36 ++--- src/world/area_arn/arn_03/events.c | 30 ++-- src/world/area_arn/arn_04/events.c | 92 ++++++------ src/world/area_arn/arn_05/events.c | 30 ++-- src/world/area_arn/arn_07/events.c | 22 +-- src/world/area_arn/arn_08/BF47A0.c | 6 +- src/world/area_arn/arn_08/events.c | 6 +- src/world/area_dgb/dgb_01/BFD9A0.c | 86 +++++------ src/world/area_dgb/dgb_02/C2EBA0.c | 66 ++++---- src/world/area_dgb/dgb_03/C31730.c | 92 ++++++------ src/world/area_dgb/dgb_04/C36530.c | 136 ++++++++--------- src/world/area_dgb/dgb_05/C3AA10.c | 66 ++++---- src/world/area_dgb/dgb_07/C3DBF0.c | 66 ++++---- src/world/area_dgb/dgb_08/C3FDB0.c | 102 ++++++------- src/world/area_dgb/dgb_09/C46BE0.c | 142 +++++++++--------- src/world/area_dgb/dgb_15/C4F510.c | 26 ++-- src/world/area_dgb/dgb_16/C52540.c | 66 ++++---- src/world/area_dgb/dgb_18/C55F40.c | 14 +- src/world/area_dro/dro_01/95B7E0.c | 16 +- src/world/area_dro/dro_02/9694C0.c | 30 ++-- src/world/area_flo/flo_00/C9DF60.c | 10 +- src/world/area_flo/flo_08/CAED40.c | 26 ++-- src/world/area_flo/flo_08/CAFAC0.c | 16 +- src/world/area_flo/flo_09/CB5320.c | 22 +-- src/world/area_flo/flo_13/CC3850.c | 126 ++++++++-------- src/world/area_flo/flo_14/CCB310.c | 8 +- src/world/area_flo/flo_14/CCBE20.c | 22 +-- src/world/area_flo/flo_16/CD1F10.c | 26 ++-- src/world/area_flo/flo_16/CD2C80.c | 30 ++-- src/world/area_flo/flo_17/CD7350.c | 104 ++++++------- src/world/area_flo/flo_23/CEE2A0.c | 10 +- src/world/area_flo/flo_25/CF2C10.c | 30 ++-- src/world/area_gv/gv_01/E1E460.c | 12 +- src/world/area_hos/hos_02/A17210.c | 8 +- src/world/area_hos/hos_03/A1BDB0.c | 4 +- src/world/area_iwa/iwa_01/90FBD0.c | 12 +- src/world/area_iwa/iwa_02/915D70.c | 12 +- src/world/area_iwa/iwa_03/918EF0.c | 12 +- src/world/area_iwa/iwa_04/91B8E0.c | 12 +- src/world/area_jan/jan_02/B2C8A0.c | 10 +- src/world/area_jan/jan_03/B34BD0.c | 10 +- src/world/area_jan/jan_05/B4B260.c | 32 ++-- src/world/area_jan/jan_06/B52B40.c | 8 +- src/world/area_jan/jan_06/B52F70.c | 32 ++-- src/world/area_jan/jan_07/B59870.c | 32 ++-- src/world/area_jan/jan_08/B5F650.c | 32 ++-- src/world/area_jan/jan_09/B663F0.c | 32 ++-- src/world/area_jan/jan_12/B73570.c | 32 ++-- src/world/area_jan/jan_22/B84180.c | 10 +- src/world/area_kkj/kkj_00/ABB340.c | 10 +- src/world/area_kkj/kkj_01/AC5170.c | 10 +- src/world/area_kmr/kmr_00/8ABF90.c | 12 +- src/world/area_kmr/kmr_05/8CE070.c | 2 +- src/world/area_kmr/kmr_06/8D1510.c | 2 +- src/world/area_kmr/kmr_09/8D5E00.c | 4 +- src/world/area_kpa/kpa_91/A86A50.c | 10 +- src/world/area_kpa/kpa_95/A8CB60.c | 10 +- src/world/area_kzn/kzn_02/C5AC20.c | 10 +- src/world/area_kzn/kzn_03/C61020.c | 16 +- src/world/area_kzn/kzn_07/C6EA50.c | 8 +- src/world/area_kzn/kzn_08/C71ED0.c | 26 ++-- src/world/area_kzn/kzn_09/C77D00.c | 16 +- src/world/area_kzn/kzn_10/C7E4B0.c | 8 +- src/world/area_kzn/kzn_11/C80600.c | 10 +- src/world/area_kzn/kzn_17/C85DC0.c | 16 +- src/world/area_kzn/kzn_17/C887B0.c | 8 +- src/world/area_mac/mac_00/7ED280.c | 10 +- src/world/area_mac/mac_01/8017D0.c | 10 +- src/world/area_mac/mac_01/805DD0.c | 10 +- src/world/area_mac/mac_02/823BF0.c | 10 +- src/world/area_mac/mac_05/852170.c | 10 +- src/world/area_mgm/mgm_00/E0E7A0.c | 10 +- src/world/area_mim/mim_01/B93940.c | 16 +- src/world/area_mim/mim_05/BA07A0.c | 16 +- src/world/area_mim/mim_06/BA4CF0.c | 16 +- src/world/area_mim/mim_08/BAD940.c | 20 +-- src/world/area_nok/nok_02/9D7AA0.c | 10 +- src/world/area_nok/nok_11/9F4A40.c | 4 +- src/world/area_nok/nok_12/9FAD60.c | 10 +- src/world/area_nok/nok_14/A02A00.c | 4 +- src/world/area_nok/nok_15/A06F00.c | 4 +- src/world/area_omo/omo_01/D9B150.c | 8 +- src/world/area_omo/omo_04/DAD400.c | 4 +- src/world/area_omo/omo_05/DB22C0.c | 4 +- src/world/area_omo/omo_07/DBD2B0.c | 14 +- src/world/area_omo/omo_09/DCD6B0.c | 10 +- src/world/area_omo/omo_17/DEF400.c | 4 +- src/world/area_pra/pra_35/D8D270.c | 26 ++-- src/world/area_pra/pra_37/D92F40.c | 16 +- src/world/area_sam/sam_03/D110C0.c | 16 +- src/world/area_sam/sam_05/D187E0.c | 16 +- src/world/area_sam/sam_06/D203E0.c | 4 +- src/world/area_sam/sam_07/D2BD30.c | 16 +- src/world/area_sam/sam_08/D309C0.c | 16 +- src/world/area_sam/sam_10/D37BD0.c | 16 +- src/world/area_tik/tik_07/87AC00.c | 2 +- src/world/area_trd/trd_02/9A10C0.c | 10 +- src/world/area_trd/trd_04/9A88A0.c | 14 +- src/world/area_trd/trd_07/9B6C90.c | 4 +- src/world/common/Bandit_DropCoin.inc.c | 12 +- src/world/common/DeadUnkNpcAIFunc14.inc.c | 4 +- src/world/common/DeadUnkTexturePanFunc2.inc.c | 40 ++--- src/world/common/NpcJumpFunc.inc.c | 2 +- src/world/common/NpcJumpFunc2.inc.c | 2 +- src/world/common/NpcJumpFunc3.inc.c | 2 +- src/world/common/SomeItemEntityFunc.inc.c | 23 +-- src/world/common/UnkDistFunc.inc.c | 2 +- src/world/common/UnkDurationCheck.inc.c | 2 +- src/world/common/UnkFunc10.inc.c | 2 +- src/world/common/UnkFunc13.inc.c | 24 +-- src/world/common/UnkFunc13_copy.inc.c | 24 +-- src/world/common/UnkFunc14.inc.c | 10 +- src/world/common/UnkFunc14_copy.inc.c | 10 +- src/world/common/UnkFunc15.inc.c | 4 +- src/world/common/UnkFunc15_copy.inc.c | 4 +- src/world/common/UnkFunc16.inc.c | 8 +- src/world/common/UnkFunc16_copy.inc.c | 8 +- src/world/common/UnkFunc23.inc.c | 34 ++--- src/world/common/UnkFunc31.inc.c | 30 ++-- src/world/common/UnkFunc4.inc.c | 10 +- src/world/common/UnkFunc41.inc.c | 18 +-- src/world/common/UnkFunc45.inc.c | 2 +- src/world/common/UnkFunc5.inc.c | 4 +- src/world/common/UnkFunc6.inc.c | 4 +- src/world/common/UnkFunc7.inc.c | 8 +- src/world/common/UnkFunc8.inc.c | 8 +- src/world/common/UnkFunc9.inc.c | 4 +- src/world/common/UnkMusicFunc.inc.c | 24 +-- src/world/common/UnkNpcAIFunc1.inc.c | 2 +- src/world/common/UnkNpcAIFunc10.inc.c | 2 +- src/world/common/UnkNpcAIFunc11.inc.c | 4 +- src/world/common/UnkNpcAIFunc12.inc.c | 2 +- src/world/common/UnkNpcAIFunc13.inc.c | 2 +- src/world/common/UnkNpcAIFunc13_2.inc.c | 2 +- src/world/common/UnkNpcAIFunc14.inc.c | 4 +- src/world/common/UnkNpcAIFunc15.inc.c | 2 +- src/world/common/UnkNpcAIFunc16.inc.c | 2 +- src/world/common/UnkNpcAIFunc17.inc.c | 2 +- src/world/common/UnkNpcAIFunc18.inc.c | 4 +- src/world/common/UnkNpcAIFunc19.inc.c | 2 +- src/world/common/UnkNpcAIFunc1_copy.inc.c | 2 +- src/world/common/UnkNpcAIFunc2.inc.c | 2 +- src/world/common/UnkNpcAIFunc20.inc.c | 2 +- src/world/common/UnkNpcAIFunc21.inc.c | 2 +- src/world/common/UnkNpcAIFunc22.inc.c | 4 +- src/world/common/UnkNpcAIFunc23.inc.c | 4 +- src/world/common/UnkNpcAIFunc24.inc.c | 8 +- src/world/common/UnkNpcAIFunc25.inc.c | 8 +- src/world/common/UnkNpcAIFunc3.inc.c | 2 +- src/world/common/UnkNpcAIFunc4.inc.c | 2 +- src/world/common/UnkNpcAIFunc5.inc.c | 2 +- src/world/common/UnkNpcAIFunc6.inc.c | 2 +- src/world/common/UnkNpcAIFunc7.inc.c | 2 +- src/world/common/UnkNpcAIFunc8.inc.c | 2 +- src/world/common/UnkNpcAIFunc9.inc.c | 2 +- src/world/common/UnkNpcDurationFlagFunc.inc.c | 4 +- src/world/common/UnkPartnerFuncs.inc.c | 27 ++-- src/world/common/UnkRotatePlayer.inc.c | 6 +- src/world/common/UnkSetDurationFunc.inc.c | 2 +- src/world/common/UnkTexturePanFunc2.inc.c | 40 ++--- .../common/set_script_owner_npc_anim.inc.c | 2 +- .../set_script_owner_npc_col_height.inc.c | 2 +- src/world/script_api/7E0E80.c | 8 +- src/world/script_api/7E2AA0.c | 14 +- src/world/script_api/7E4690.c | 8 +- tools/substitute2.py | 10 +- .../BindNpcAI.s | 0 .../RemoveEncounter.s | 0 .../RemoveNpc.s | 0 .../SetNpcAux.s | 0 .../StartBossBattle.s | 0 .../start_battle.s | 0 .../entity_base_block_update_slow_sinking.s | 0 .../Block}/entity_block_handle_collision.s | 0 .../entity_BlueWarpPipe_setupGfx.s | 0 .../Chest}/entity_Chest_adjust_camera.s | 0 .../Chest}/entity_Chest_begin_opening.s | 0 .../Chest}/entity_Chest_check_opened.s | 0 .../Chest}/entity_Chest_clear_item_id.s | 0 .../Chest}/entity_Chest_close.s | 0 .../Chest}/entity_Chest_enable_player_input.s | 0 .../Chest}/entity_Chest_idle.s | 0 .../Chest}/entity_Chest_init.s | 0 .../Chest}/entity_Chest_open.s | 0 .../Chest}/entity_Chest_readargs.s | 0 .../Chest}/entity_Chest_reset_camera.s | 0 .../Chest}/entity_Chest_setupGfx.s | 0 .../Chest}/entity_Chest_start_bound_script.s | 0 .../Chest}/entity_GiantChest_await_got_item.s | 0 .../Chest}/entity_GiantChest_give_equipment.s | 0 .../Chest}/entity_GiantChest_hide_effect.s | 0 .../Chest}/entity_GiantChest_init.s | 0 .../Chest}/entity_GiantChest_open.s | 0 .../entity_HeartBlockContent__anim_heal.s | 0 .../entity_HeartBlockContent__setupGfx.s | 0 .../entity_HeartBlockContent_anim_beating.s | 0 .../entity_HeartBlockContent_anim_idle.s | 0 ...ntity_HeartBlockContent_get_previous_yaw.s | 0 .../ItemBlock}/entity_HitItemBlock_appear.s | 0 .../ItemBlock}/entity_ItemBlock_spawn_item.s | 0 .../SaveBlock}/entity_SaveBlock_setupGfx.s | 0 .../entity_HiddenPanel_flip_over.s | 0 .../SimpleSpring}/entity_HiddenPanel_hide.s | 0 .../SimpleSpring}/entity_HiddenPanel_idle.s | 0 .../SimpleSpring}/entity_HiddenPanel_init.s | 0 .../entity_HiddenPanel_is_item_on_top.s | 0 ...entity_HiddenPanel_set_ispy_notification.s | 0 .../entity_HiddenPanel_setupGfx.s | 0 .../SimpleSpring}/entity_ScriptSpring_idle.s | 0 .../entity_SimpleSpring_enable_player_input.s | 0 .../SimpleSpring}/entity_SimpleSpring_idle.s | 0 .../SimpleSpring}/entity_SimpleSpring_init.s | 0 .../entity_SimpleSpring_set_jump_params.s | 0 .../entity_SuperBlock_HitEffect_setupGfx.s | 0 .../Switch}/entity_RedSwitch_animate_scale.s | 0 .../entity_base_switch_animate_scale.s | 0 .../Switch}/entity_shattering_idle.s | 0 .../Switch}/entity_shattering_init_pieces.s | 0 .../Switch}/entity_shattering_setupGfx.s | 0 .../entity_WoodenCrate_init_fragments.s | 0 .../entity_WoodenCrate_setupGfx.s | 0 .../entity_WoodenCrate_update_fragments.s | 0 ver/us/splat.yaml | 24 +-- 270 files changed, 1859 insertions(+), 1855 deletions(-) delete mode 100644 src/107830_len_e70.c delete mode 100644 src/1086a0_len_fc0.c rename src/{1f580_len_1940.c => encounter_api.c} (95%) rename src/{104940_len_dc0.c => entity/Block.c} (98%) rename src/{10A230.c => entity/BlueWarpPipe.c} (98%) create mode 100644 src/entity/Chest.c rename src/{105F90.c => entity/HeartBlock.c} (90%) rename src/{105700_len_2130.c => entity/ItemBlock.c} (97%) rename src/{102610_len_2330.c => entity/SaveBlock.c} (97%) rename src/{10A8D0.c => entity/Signpost.c} (100%) create mode 100644 src/entity/SimpleSpring.c rename src/{106EF0.c => entity/SuperBlock.c} (97%) rename src/{102C80.c => entity/Switch.c} (97%) rename src/{109660_len_1270.c => entity/WoodenCrate.c} (91%) rename ver/us/asm/nonmatchings/{1f580_len_1940 => encounter_api}/BindNpcAI.s (100%) rename ver/us/asm/nonmatchings/{1f580_len_1940 => encounter_api}/RemoveEncounter.s (100%) rename ver/us/asm/nonmatchings/{1f580_len_1940 => encounter_api}/RemoveNpc.s (100%) rename ver/us/asm/nonmatchings/{1f580_len_1940 => encounter_api}/SetNpcAux.s (100%) rename ver/us/asm/nonmatchings/{1f580_len_1940 => encounter_api}/StartBossBattle.s (100%) rename ver/us/asm/nonmatchings/{1f580_len_1940 => encounter_api}/start_battle.s (100%) rename ver/us/asm/nonmatchings/{104940_len_dc0 => entity/Block}/entity_base_block_update_slow_sinking.s (100%) rename ver/us/asm/nonmatchings/{104940_len_dc0 => entity/Block}/entity_block_handle_collision.s (100%) rename ver/us/asm/nonmatchings/{10A230 => entity/BlueWarpPipe}/entity_BlueWarpPipe_setupGfx.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_adjust_camera.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_begin_opening.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_check_opened.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_clear_item_id.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_close.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_enable_player_input.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_idle.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_init.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_open.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_readargs.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_reset_camera.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_setupGfx.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_Chest_start_bound_script.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_GiantChest_await_got_item.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_GiantChest_give_equipment.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_GiantChest_hide_effect.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_GiantChest_init.s (100%) rename ver/us/asm/nonmatchings/{1086a0_len_fc0 => entity/Chest}/entity_GiantChest_open.s (100%) rename ver/us/asm/nonmatchings/{105F90 => entity/HeartBlock}/entity_HeartBlockContent__anim_heal.s (100%) rename ver/us/asm/nonmatchings/{105F90 => entity/HeartBlock}/entity_HeartBlockContent__setupGfx.s (100%) rename ver/us/asm/nonmatchings/{105F90 => entity/HeartBlock}/entity_HeartBlockContent_anim_beating.s (100%) rename ver/us/asm/nonmatchings/{105F90 => entity/HeartBlock}/entity_HeartBlockContent_anim_idle.s (100%) rename ver/us/asm/nonmatchings/{105F90 => entity/HeartBlock}/entity_HeartBlockContent_get_previous_yaw.s (100%) rename ver/us/asm/nonmatchings/{105700_len_2130 => entity/ItemBlock}/entity_HitItemBlock_appear.s (100%) rename ver/us/asm/nonmatchings/{105700_len_2130 => entity/ItemBlock}/entity_ItemBlock_spawn_item.s (100%) rename ver/us/asm/nonmatchings/{102610_len_2330 => entity/SaveBlock}/entity_SaveBlock_setupGfx.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_HiddenPanel_flip_over.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_HiddenPanel_hide.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_HiddenPanel_idle.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_HiddenPanel_init.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_HiddenPanel_is_item_on_top.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_HiddenPanel_set_ispy_notification.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_HiddenPanel_setupGfx.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_ScriptSpring_idle.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_SimpleSpring_enable_player_input.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_SimpleSpring_idle.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_SimpleSpring_init.s (100%) rename ver/us/asm/nonmatchings/{107830_len_e70 => entity/SimpleSpring}/entity_SimpleSpring_set_jump_params.s (100%) rename ver/us/asm/nonmatchings/{106EF0 => entity/SuperBlock}/entity_SuperBlock_HitEffect_setupGfx.s (100%) rename ver/us/asm/nonmatchings/{102C80 => entity/Switch}/entity_RedSwitch_animate_scale.s (100%) rename ver/us/asm/nonmatchings/{102C80 => entity/Switch}/entity_base_switch_animate_scale.s (100%) rename ver/us/asm/nonmatchings/{102C80 => entity/Switch}/entity_shattering_idle.s (100%) rename ver/us/asm/nonmatchings/{102C80 => entity/Switch}/entity_shattering_init_pieces.s (100%) rename ver/us/asm/nonmatchings/{102C80 => entity/Switch}/entity_shattering_setupGfx.s (100%) rename ver/us/asm/nonmatchings/{109660_len_1270 => entity/WoodenCrate}/entity_WoodenCrate_init_fragments.s (100%) rename ver/us/asm/nonmatchings/{109660_len_1270 => entity/WoodenCrate}/entity_WoodenCrate_setupGfx.s (100%) rename ver/us/asm/nonmatchings/{109660_len_1270 => entity/WoodenCrate}/entity_WoodenCrate_update_fragments.s (100%) diff --git a/include/common_structs.h b/include/common_structs.h index 89475ba5b7..81500e708a 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -293,7 +293,7 @@ typedef struct ScriptInstance { /* 0x064 */ struct ScriptInstance* blockingParent; /* parent? */ /* 0x068 */ struct ScriptInstance* childScript; /* 0x06C */ struct ScriptInstance* parentScript; /* brother? */ - /* 0x070 */ X32 functionTemp[4]; + /* 0x070 */ s32 functionTemp[4]; /* 0x080 */ ApiFunc callFunction; /* 0x084 */ s32 varTable[16]; /* 0x0C4 */ s32 varFlags[3]; diff --git a/src/107830_len_e70.c b/src/107830_len_e70.c deleted file mode 100644 index ff3e0b8113..0000000000 --- a/src/107830_len_e70.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "common.h" - -INCLUDE_ASM(s32, "107830_len_e70", entity_ScriptSpring_idle); - -INCLUDE_ASM(s32, "107830_len_e70", entity_SimpleSpring_idle); - -INCLUDE_ASM(s32, "107830_len_e70", entity_SimpleSpring_set_jump_params); - -INCLUDE_ASM(s32, "107830_len_e70", entity_SimpleSpring_enable_player_input); - -void entity_ScriptSpring_init(void) { -} - -INCLUDE_ASM(s32, "107830_len_e70", entity_SimpleSpring_init); - -INCLUDE_ASM(s32, "107830_len_e70", entity_HiddenPanel_setupGfx); - -INCLUDE_ASM(s32, "107830_len_e70", entity_HiddenPanel_set_ispy_notification); - -INCLUDE_ASM(s32, "107830_len_e70", entity_HiddenPanel_hide); - -INCLUDE_ASM(s32, "107830_len_e70", entity_HiddenPanel_idle); - -INCLUDE_ASM(s32, "107830_len_e70", entity_HiddenPanel_flip_over); - -INCLUDE_ASM(s32, "107830_len_e70", entity_HiddenPanel_is_item_on_top); - -INCLUDE_ASM(s32, "107830_len_e70", entity_HiddenPanel_init); diff --git a/src/1086a0_len_fc0.c b/src/1086a0_len_fc0.c deleted file mode 100644 index f6bb970757..0000000000 --- a/src/1086a0_len_fc0.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "common.h" - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_adjust_camera); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_reset_camera); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_setupGfx); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_check_opened); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_idle); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_begin_opening); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_open); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_close); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_GiantChest_hide_effect); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_GiantChest_open); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_GiantChest_give_equipment); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_start_bound_script); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_enable_player_input); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_GiantChest_await_got_item); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_clear_item_id); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_readargs); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_GiantChest_init); - -INCLUDE_ASM(s32, "1086a0_len_fc0", entity_Chest_init); diff --git a/src/181810.c b/src/181810.c index e35054bca8..f19d475aa6 100644 --- a/src/181810.c +++ b/src/181810.c @@ -58,7 +58,7 @@ ApiStatus ActorSpeak(ScriptInstance* script, s32 isInitialCall) { } msg_printer_set_origin_pos(gSpeakingActorPrintCtx, screenX, screenY); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; gOverrideFlags |= 0x10; if (gSpeakingActorTalkAnim >= 0) { func_80263E08(actor, part, gSpeakingActorTalkAnim); @@ -66,7 +66,7 @@ ApiStatus ActorSpeak(ScriptInstance* script, s32 isInitialCall) { increment_status_menu_disabled(); } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { actor = gSpeakingActor; part = gSpeakingActorPart; @@ -116,11 +116,11 @@ ApiStatus ShowBattleChoice(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { s32 stringID = get_variable(script, *args); - script->functionTemp[1].s = 0; - D_8029FA64 = msg_get_printer_for_string(stringID, &script->functionTemp[1].s); + script->functionTemp[1] = 0; + D_8029FA64 = msg_get_printer_for_string(stringID, &script->functionTemp[1]); } - if (script->functionTemp[1].s == 1) { + if (script->functionTemp[1] == 1) { u8 currentOption = D_8029FA64->currentOption; gSpeakingActorPrintCtx->currentOption = D_8029FA64->currentOption; diff --git a/src/18F340.c b/src/18F340.c index 993093fe05..cccab6d3d4 100644 --- a/src/18F340.c +++ b/src/18F340.c @@ -157,26 +157,26 @@ ApiStatus func_802610CC(ScriptInstance* script, s32 isInitialCall) { mdl_set_all_fog_mode(1); *D_801512F0 = 1; set_background_color_blend(0, 0, 0, 0); - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, ((20 - script->functionTemp[0].s) * 12) & 0xFC); + set_background_color_blend(0, 0, 0, ((20 - script->functionTemp[0]) * 12) & 0xFC); - script->functionTemp[0].s -= 1; + script->functionTemp[0] -= 1; do {} while(0); // TODO required to match - return (script->functionTemp[0].s == 0) * ApiStatus_DONE2; + return (script->functionTemp[0] == 0) * ApiStatus_DONE2; } ApiStatus func_80261164(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; btl_cam_unfreeze(); } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 12) & 0xFC); + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 12) & 0xFC); - script->functionTemp[0].s -= 1; - if (script->functionTemp[0].s == 0) { + script->functionTemp[0] -= 1; + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } @@ -267,25 +267,25 @@ ApiStatus func_80261530(ScriptInstance* script, s32 isInitialCall) { mdl_set_all_fog_mode(1); *D_801512F0 = 1; set_background_color_blend(0, 0, 0, 0); - script->functionTemp[0].s = 25; + script->functionTemp[0] = 25; } - set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0].s) * 10) & 0xFE); + set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 0xFE); - script->functionTemp[0].s--; + script->functionTemp[0]--; do {} while(0); // TODO required to match - return (script->functionTemp[0].s == 0) * ApiStatus_DONE2; + return (script->functionTemp[0] == 0) * ApiStatus_DONE2; } ApiStatus func_802615C8(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 25; + script->functionTemp[0] = 25; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 10) & 0xFF); + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 0xFF); - script->functionTemp[0].s -= 5; - if (script->functionTemp[0].s == 0) { + script->functionTemp[0] -= 5; + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } @@ -327,7 +327,7 @@ ApiStatus func_802616F4(ScriptInstance* script, s32 isInitialCall) { EffectInstanceData* effectInstanceData; if (isInitialCall) { - script->functionTemp[1].s = 0; + script->functionTemp[1] = 0; D_8029FB94 = merlee->pos.y; D_8029FB98 = playFX_52(0, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.4f, 0); D_8029FB9C = playFX_52(3, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.00001f, 0); @@ -335,10 +335,10 @@ ApiStatus func_802616F4(ScriptInstance* script, s32 isInitialCall) { D_8029FB90 = 12; sfx_play_sound(0x2074); } - merlee->pos.y = D_8029FB94 + (sin_rad((script->functionTemp[1].s * TAU) / 360.0f) * 3.0f); + merlee->pos.y = D_8029FB94 + (sin_rad((script->functionTemp[1] * TAU) / 360.0f) * 3.0f); - script->functionTemp[1].s += 10; - script->functionTemp[1].s = clamp_angle(script->functionTemp[1].s); + script->functionTemp[1] += 10; + script->functionTemp[1] = clamp_angle(script->functionTemp[1]); effectInstanceData = D_8029FB98->data; effectInstanceData->pos.x = merlee->pos.x; @@ -497,13 +497,13 @@ ApiStatus func_80261FB4(ScriptInstance* script, s32 isInitialCall) { f32 deltaZ; if (isInitialCall) { - script->functionTemp[0].s = 0; - script->functionTemp[1].s = 10; + script->functionTemp[0] = 0; + script->functionTemp[1] = 10; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: - ft1 = script->functionTemp[1].s; + ft1 = script->functionTemp[1]; deltaX = player->currentPos.x - item->position.x; deltaY = player->currentPos.y + 12.0f - item->position.y; deltaZ = player->currentPos.z - 5.0f - item->position.z; @@ -515,11 +515,11 @@ ApiStatus func_80261FB4(ScriptInstance* script, s32 isInitialCall) { item->position.y += dist2D(item->position.x, item->position.y, player->currentPos.x, player->currentPos.y + 12.0f) / 5.0f; - if (script->functionTemp[1].s == 1) { - script->functionTemp[0].s = script->functionTemp[1].s; + if (script->functionTemp[1] == 1) { + script->functionTemp[0] = script->functionTemp[1]; } - script->functionTemp[1].s--; + script->functionTemp[1]--; break; case 1: return ApiStatus_DONE2; diff --git a/src/19FAF0.c b/src/19FAF0.c index 2bde96c596..34888c1f4c 100644 --- a/src/19FAF0.c +++ b/src/19FAF0.c @@ -120,14 +120,14 @@ ApiStatus PlayerLandJump(ScriptInstance *script, s32 isInitialCall) { ActorMovementWalk* walkMovement = &player->walk; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { walkMovement->currentPos.x = player->currentPos.x; walkMovement->currentPos.y = player->currentPos.y; walkMovement->currentPos.z = player->currentPos.z; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } if (walkMovement->velocity > 0.0f) { diff --git a/src/1a1f0_len_5390.c b/src/1a1f0_len_5390.c index aa492d0463..0ef4f1829e 100644 --- a/src/1a1f0_len_5390.c +++ b/src/1a1f0_len_5390.c @@ -52,24 +52,24 @@ ApiStatus FadeBackgroundToBlack(ScriptInstance* script, s32 isInitialCall) { mdl_set_all_fog_mode(1); *D_801512F0 = 1; set_background_color_blend(0, 0, 0, 0); - script->functionTemp[0].s = 25; + script->functionTemp[0] = 25; } - set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0].s) * 10) & 254); - script->functionTemp[0].s--; + set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254); + script->functionTemp[0]--; do {} while (0); - return (script->functionTemp[0].s == 0) * ApiStatus_DONE2; + return (script->functionTemp[0] == 0) * ApiStatus_DONE2; } ApiStatus UnfadeBackgroundFromBlack(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 25; + script->functionTemp[0] = 25; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 10) & 0xFE); - script->functionTemp[0].s -= 5; + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 0xFE); + script->functionTemp[0] -= 5; - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } else { @@ -112,7 +112,7 @@ ApiStatus MerleeUpdateFX(ScriptInstance* script, s32 isInitialCall) { EffectInstanceData* effectInstanceData; if (isInitialCall) { - script->functionTemp[1].s = 0; + script->functionTemp[1] = 0; D_800A0BA4 = merlee->pos.y; D_800A0BA8 = playFX_52(0, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.4f, 0); D_800A0BAC = playFX_52(3, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.00001f, 0); @@ -121,10 +121,10 @@ ApiStatus MerleeUpdateFX(ScriptInstance* script, s32 isInitialCall) { sfx_play_sound(0x2074); } - merlee->pos.y = D_800A0BA4 + (sin_rad((script->functionTemp[1].s * TAU) / 360.0f) * 3.0f); + merlee->pos.y = D_800A0BA4 + (sin_rad((script->functionTemp[1] * TAU) / 360.0f) * 3.0f); - script->functionTemp[1].s += 10; - script->functionTemp[1].s = clamp_angle(script->functionTemp[1].s); + script->functionTemp[1] += 10; + script->functionTemp[1] = clamp_angle(script->functionTemp[1]); effectInstanceData = D_800A0BA8->data; effectInstanceData->pos.x = merlee->pos.x; @@ -212,32 +212,32 @@ ApiStatus OnDefeatEnemy(ScriptInstance* script, s32 isInitialCall) { s32 temp1; if (isInitialCall) { - script->functionTemp[0].s = 0; - script->functionTemp[1].s = 20; + script->functionTemp[0] = 0; + script->functionTemp[1] = 20; } - if (script->functionTemp[1].s & 1) { + if (script->functionTemp[1] & 1) { npc->flags &= ~2; } else { npc->flags |= 2; } - if (script->functionTemp[1].s == 15) { + if (script->functionTemp[1] == 15) { sfx_play_sound(SOUND_DEATH); playFX_18(1, npc->pos.x, npc->pos.y + (npc->collisionHeight / 2), npc->pos.z, 0, -1.0f, 0, 10); } - temp1 = script->functionTemp[1].s; - if (script->functionTemp[1].s == 10) { + temp1 = script->functionTemp[1]; + if (script->functionTemp[1] == 10) { playFX_01(npc->pos.x, npc->pos.y + 10.0f, npc->pos.z + 10.0f); - if (script->functionTemp[1].s == temp1) { // what? (never can be false, seemingly) + if (script->functionTemp[1] == temp1) { // what? (never can be false, seemingly) spawn_drops(enemy); } } - script->functionTemp[1].s -= 1; + script->functionTemp[1] -= 1; - if (script->functionTemp[1].s == 0) { + if (script->functionTemp[1] == 0) { npc->flags |= 2; return ApiStatus_DONE1; } @@ -250,13 +250,13 @@ ApiStatus OnFleeBattleDrops(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; if (isInitialCall) { - script->functionTemp[0].s = 0; - script->functionTemp[1].s = 40; - script->functionTemp[2].s = 0; + script->functionTemp[0] = 0; + script->functionTemp[1] = 40; + script->functionTemp[2] = 0; } - script->functionTemp[2].s++; - if (script->functionTemp[2].s >= 5) { + script->functionTemp[2]++; + if (script->functionTemp[2] >= 5) { if (rand_int(100) < 50) { if (playerData->coins != 0) { playerData->coins--; @@ -264,10 +264,10 @@ ApiStatus OnFleeBattleDrops(ScriptInstance* script, s32 isInitialCall) { playerStatus->position.z, 3, 0, 0); } } - script->functionTemp[2].s = 0; + script->functionTemp[2] = 0; } - return --script->functionTemp[1].s == 0; + return --script->functionTemp[1] == 0; } /// Default/neutral state during world gameplay; checks for player-enemy collisions and initiates battles when they occur. diff --git a/src/23680.c b/src/23680.c index 07ca0b3f7d..3bd5fb00c4 100644 --- a/src/23680.c +++ b/src/23680.c @@ -148,7 +148,7 @@ void func_80049550(ScriptInstance* script, s32 arg1) { npc->duration--; if (npc->duration <= 0) { - script->functionTemp[0].s = arg1; + script->functionTemp[0] = arg1; } } @@ -171,7 +171,7 @@ void func_80049E3C(ScriptInstance* script) { npc->jumpScale = 2.5f; npc->moveToPos.y = npc->pos.y; npc->flags |= 0x800; - script->functionTemp[0].s = 11; + script->functionTemp[0] = 11; } void func_80049ECC(ScriptInstance* script) { @@ -191,7 +191,7 @@ void func_80049ECC(ScriptInstance* script) { } else { npc->jumpVelocity = 0.0f; npc->flags &= ~0x800; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -207,7 +207,7 @@ void func_8004A3E8(ScriptInstance* script, s32 arg1) { if (npc->duration == 0) { npc->yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z)); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } diff --git a/src/25AF0.c b/src/25AF0.c index 800983c70b..3bde30614b 100644 --- a/src/25AF0.c +++ b/src/25AF0.c @@ -6,7 +6,7 @@ void func_8004A6F0(ScriptInstance* script) { npc->duration--; if (npc->duration <= 0) { - script->functionTemp[0].s = script->functionTemp[1].s; + script->functionTemp[0] = script->functionTemp[1]; } } @@ -15,7 +15,7 @@ void func_8004A73C(ScriptInstance* script) { get_npc_unsafe(enemy->npcID); if (enemy->unk_B4 == 0) { - script->functionTemp[0].s = script->functionTemp[1].s; + script->functionTemp[0] = script->functionTemp[1]; } } diff --git a/src/battle/area_trd_part_3/4CF1B0.c b/src/battle/area_trd_part_3/4CF1B0.c index d3fa64ecb8..357f61f2fe 100644 --- a/src/battle/area_trd_part_3/4CF1B0.c +++ b/src/battle/area_trd_part_3/4CF1B0.c @@ -55,13 +55,13 @@ ApiStatus func_80218170_4CF320(ScriptInstance* script, s32 isInitialCall) { BattleStatus* battleStatus = &gBattleStatus; if (isInitialCall) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } battleStatus->flags2 &= ~0x2; - if (script->functionTemp[0].s != 0) { - script->functionTemp[0].s--; + if (script->functionTemp[0] != 0) { + script->functionTemp[0]--; return ApiStatus_BLOCK; } @@ -72,13 +72,13 @@ ApiStatus func_802181B4_4CF364(ScriptInstance* script, s32 isInitialCall) { BattleStatus* battleStatus = &gBattleStatus; if (isInitialCall) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } battleStatus->flags2 &= ~0x4; - if (script->functionTemp[0].s != 0) { - script->functionTemp[0].s--; + if (script->functionTemp[0] != 0) { + script->functionTemp[0]--; return ApiStatus_BLOCK; } diff --git a/src/battle/item/dizzy_dial.c b/src/battle/item/dizzy_dial.c index c7046369a1..67f55abef0 100644 --- a/src/battle/item/dizzy_dial.c +++ b/src/battle/item/dizzy_dial.c @@ -63,24 +63,24 @@ ApiStatus N(func_802A1270_727B80)(ScriptInstance* script, s32 isInitialCall) { f32 a; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: - script->functionTemp[1].s = 0; - script->functionTemp[2].s = 0; + script->functionTemp[1] = 0; + script->functionTemp[2] = 0; sfx_play_sound(0x2033); camera->unk_1C = 0; D_802A1CD0 = create_generic_entity_frontUI(NULL, func_802A123C_727B4C); - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; case 1: camera->flags |= 8; - a = script->functionTemp[1].s; + a = script->functionTemp[1]; guRotateF(camera->viewMtxShaking, a, 0.0f, 0.0f, 1.0f); - script->functionTemp[1].s = 2.0 * ((1.0 - sin_rad(((script->functionTemp[2].s + 90) * 6.28318f) / 360.0f)) * 360.0); - script->functionTemp[2].s++; - if (script->functionTemp[2].s <= 90) { + script->functionTemp[1] = 2.0 * ((1.0 - sin_rad(((script->functionTemp[2] + 90) * 6.28318f) / 360.0f)) * 360.0); + script->functionTemp[2]++; + if (script->functionTemp[2] <= 90) { return ApiStatus_BLOCK; } camera->unk_1C = 0; diff --git a/src/battle/item/fire_flower.c b/src/battle/item/fire_flower.c index 2da3e4cb34..8aed985847 100644 --- a/src/battle/item/fire_flower.c +++ b/src/battle/item/fire_flower.c @@ -68,13 +68,13 @@ ApiStatus N(func_802A123C_716E9C)(ScriptInstance* script, s32 isInitialCall) { ApiStatus N(func_802A1378_716FD8)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 10) & 254); + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); - script->functionTemp[0].s--; - if (script->functionTemp[0].s == 0) { + script->functionTemp[0]--; + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/battle/item/fright_jar.c b/src/battle/item/fright_jar.c index e2da79b0c3..d5c4996c9d 100644 --- a/src/battle/item/fright_jar.c +++ b/src/battle/item/fright_jar.c @@ -57,13 +57,13 @@ ApiStatus N(GiveRefundCleanup)(ScriptInstance* script, s32 isInitialCall) { ApiStatus N(func_802A12D4_72BBE4)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 10) & 254); + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); - script->functionTemp[0].s--; - if (script->functionTemp[0].s == 0) { + script->functionTemp[0]--; + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/battle/item/shooting_star.c b/src/battle/item/shooting_star.c index 138b192d20..a474572782 100644 --- a/src/battle/item/shooting_star.c +++ b/src/battle/item/shooting_star.c @@ -120,22 +120,22 @@ ApiStatus N(func_802A1444_71DBB4)(ScriptInstance* script, s32 isInitialCall) { mdl_set_all_fog_mode(1); *D_801512F0 = 1; set_background_color_blend(0, 0, 0, 0); - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } - set_background_color_blend(0, 0, 0, ((10 - script->functionTemp[0].s) * 16) & 240); - script->functionTemp[0].s--; + set_background_color_blend(0, 0, 0, ((10 - script->functionTemp[0]) * 16) & 240); + script->functionTemp[0]--; do {} while (0); - return (script->functionTemp[0].s == 0) * ApiStatus_DONE2; + return (script->functionTemp[0] == 0) * ApiStatus_DONE2; } ApiStatus N(func_802A14D4_71DC44)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 16) & 240); - script->functionTemp[0].s--; - if (script->functionTemp[0].s == 0) { + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 16) & 240); + script->functionTemp[0]--; + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; diff --git a/src/battle/item/sleepy_sheep.c b/src/battle/item/sleepy_sheep.c index b0bed93175..2b5474440c 100644 --- a/src/battle/item/sleepy_sheep.c +++ b/src/battle/item/sleepy_sheep.c @@ -106,10 +106,10 @@ ApiStatus func_802A123C_71E88C(ScriptInstance* script, s32 isInitialCall) { s32* D_802A3F58_ptr; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: { s32* D_802A3F28_721578_ptr = &N(D_802A3F28_721578); s32 loop1, loop2, loop3; @@ -134,16 +134,16 @@ ApiStatus func_802A123C_71E88C(ScriptInstance* script, s32 isInitialCall) { D_802A3E88_7214D8_ptr2 += i * 3 + 1; D_802A3E88_7214D8_ptr3 += i * 3 + 2; } - script->functionTemp[0].s = 1; - script->functionTemp[1].s = gGameStatusPtr->frameCounter % 10; + script->functionTemp[0] = 1; + script->functionTemp[1] = gGameStatusPtr->frameCounter % 10; } break; case 1: D_802A3F88.x += 6.0f; if (gGameStatusPtr->frameCounter % 3 == 0) { - script->functionTemp[1].s++; - script->functionTemp[1].s %= 10; + script->functionTemp[1]++; + script->functionTemp[1] %= 10; } flag = 0; @@ -164,7 +164,7 @@ ApiStatus func_802A123C_71E88C(ScriptInstance* script, s32 isInitialCall) { virtual_entity_set_pos(D_802A3F58_ptr[i], x, y, z); - if (flag == 0 && script->functionTemp[1].s == i) { + if (flag == 0 && script->functionTemp[1] == i) { f32 x2, y2; if (gGameStatusPtr->frameCounter % 5 == 0) { @@ -195,7 +195,7 @@ ApiStatus func_802A123C_71E88C(ScriptInstance* script, s32 isInitialCall) { N(D_802A3E88_7214D8)[randIdx * 3 + 2] + D_802A3F88_ptr->z, 0); } if (D_802A3F88_ptr->x >= 320.0f) { - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; break; } return ApiStatus_DONE2; @@ -221,8 +221,8 @@ ApiStatus N(func_802A1740_71ED90)(ScriptInstance* script, s32 isInitialCall) { s32 i; if (isInitialCall) { - script->functionTemp[0].s = 0; - script->functionTemp[1].s = 0x5A; + script->functionTemp[0] = 0; + script->functionTemp[1] = 0x5A; } for (i = 0; i < player->targetListLength; i++) { @@ -237,8 +237,8 @@ ApiStatus N(func_802A1740_71ED90)(ScriptInstance* script, s32 isInitialCall) { } } - if (script->functionTemp[1].s != 0) { - script->functionTemp[1].s--; + if (script->functionTemp[1] != 0) { + script->functionTemp[1]--; return ApiStatus_BLOCK; } @@ -252,7 +252,7 @@ ApiStatus N(func_802A1848_71EE98)(ScriptInstance* script, s32 isInitialCall) { s32 ret; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } ret = 0; diff --git a/src/battle/item/snowman_doll.c b/src/battle/item/snowman_doll.c index fc9772d70c..215471bc70 100644 --- a/src/battle/item/snowman_doll.c +++ b/src/battle/item/snowman_doll.c @@ -69,13 +69,13 @@ ApiStatus N(func_802A123C_71C06C)(ScriptInstance* script, s32 isInitialCall) { ApiStatus N(func_802A13B8_71C1E8)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 10) & 254); + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); - script->functionTemp[0].s--; - if (script->functionTemp[0].s == 0) { + script->functionTemp[0]--; + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/battle/item/stone_cap.c b/src/battle/item/stone_cap.c index 39d2268718..6fa4c3f43a 100644 --- a/src/battle/item/stone_cap.c +++ b/src/battle/item/stone_cap.c @@ -59,15 +59,15 @@ ApiStatus N(func_802A123C_7217DC)(ScriptInstance* script, s32 isInitialCall) { s32 i; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: inflict_status(player, STATUS_STONE, script->varTable[0]); player->status = 0; - script->functionTemp[1].s = 3; - script->functionTemp[0].s = 1; + script->functionTemp[1] = 3; + script->functionTemp[0] = 1; break; case 1: @@ -78,7 +78,7 @@ ApiStatus N(func_802A123C_7217DC)(ScriptInstance* script, s32 isInitialCall) { playFX_69(0, x, y, z, 1.0f, 25); } - if (script->functionTemp[1].s == 0) { + if (script->functionTemp[1] == 0) { BattleStatus* battleStatus2 = &gBattleStatus; battleStatus2->flags1 &= ~0x04000000; @@ -88,7 +88,7 @@ ApiStatus N(func_802A123C_7217DC)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } - script->functionTemp[1].s--; + script->functionTemp[1]--; break; } diff --git a/src/battle/item/stop_watch.c b/src/battle/item/stop_watch.c index b1df977345..98c64b7978 100644 --- a/src/battle/item/stop_watch.c +++ b/src/battle/item/stop_watch.c @@ -57,13 +57,13 @@ ApiStatus N(GiveRefundCleanup)(ScriptInstance* script, s32 isInitialCall) { ApiStatus N(func_802A12D4_7270A4)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 10) & 254); + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); - script->functionTemp[0].s--; - if (script->functionTemp[0].s == 0) { + script->functionTemp[0]--; + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/battle/item/thunder_bolt.c b/src/battle/item/thunder_bolt.c index e231c8b818..86428f42bc 100644 --- a/src/battle/item/thunder_bolt.c +++ b/src/battle/item/thunder_bolt.c @@ -85,13 +85,13 @@ ApiStatus N(func_802A123C_722D7C)(ScriptInstance* script, s32 isInitialCall) { ApiStatus N(func_802A1420_722F60)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 10) & 254); + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); - script->functionTemp[0].s--; - if (script->functionTemp[0].s == 0) { + script->functionTemp[0]--; + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/battle/item/thunder_rage.c b/src/battle/item/thunder_rage.c index b1d6c263b3..db9c4bbd4b 100644 --- a/src/battle/item/thunder_rage.c +++ b/src/battle/item/thunder_rage.c @@ -57,13 +57,13 @@ ApiStatus N(GiveRefundCleanup)(ScriptInstance* script, s32 isInitialCall) { ApiStatus N(func_802A12D4_71B474)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0].s * 10) & 254); + set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); - script->functionTemp[0].s--; - if (script->functionTemp[0].s == 0) { + script->functionTemp[0]--; + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/battle/move/mega_quake/756780.c b/src/battle/move/mega_quake/756780.c index daf1115138..55b0763a7a 100644 --- a/src/battle/move/mega_quake/756780.c +++ b/src/battle/move/mega_quake/756780.c @@ -8,24 +8,24 @@ ApiStatus func_802A10A4_756824(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s != 0) { - if (script->functionTemp[0].s != 1) { + if (script->functionTemp[0] != 0) { + if (script->functionTemp[0] != 1) { return ApiStatus_BLOCK; } } else { - script->functionTemp[1].s = 30; - script->functionTemp[0].s = 1; + script->functionTemp[1] = 30; + script->functionTemp[0] = 1; } set_screen_overlay_center(1, 0, 0, 0); set_screen_overlay_center(1, 1, 320, 240); set_screen_overlay_params_back(12, 160.0f); - if (script->functionTemp[1].s != 0) { - script->functionTemp[1].s--; + if (script->functionTemp[1] != 0) { + script->functionTemp[1]--; return ApiStatus_BLOCK; } else { set_screen_overlay_center(1, 0, 0, 0); diff --git a/src/battle/partner/goombario.c b/src/battle/partner/goombario.c index c2198fccc4..7addc6bc9b 100644 --- a/src/battle/partner/goombario.c +++ b/src/battle/partner/goombario.c @@ -64,14 +64,14 @@ ApiStatus N(func_80238A20_6F1B00)(ScriptInstance* script, s32 isInitialCall) { Vec3f* pos = &partnerActor->walk.currentPos; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { partnerActor->walk.currentPos.x = partnerActor->currentPos.x; partnerActor->walk.currentPos.y = partnerActor->currentPos.y; partnerActor->walk.currentPos.z = partnerActor->currentPos.z; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } if (partnerActor->walk.velocity > 0.0f) { diff --git a/src/battle/star/lullaby/78D150.c b/src/battle/star/lullaby/78D150.c index 17b668b3fb..ab58f0d3a6 100644 --- a/src/battle/star/lullaby/78D150.c +++ b/src/battle/star/lullaby/78D150.c @@ -16,26 +16,26 @@ INCLUDE_ASM(s32, "battle/star/lullaby/78D150", func_802A1494_78D5E4); ApiStatus func_802A1518_78D668(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { s32 temp; s32 temp2; case 0: - script->functionTemp[2].s = -80; - script->functionTemp[1].s = 0; - script->functionTemp[0].s = 1; + script->functionTemp[2] = -80; + script->functionTemp[1] = 0; + script->functionTemp[0] = 1; case 1: - temp = script->functionTemp[2].s; - temp2 = (sin_rad((script->functionTemp[1].s * TAU) / 360.0f) * 30.0f) + 30.0f; + temp = script->functionTemp[2]; + temp2 = (sin_rad((script->functionTemp[1] * TAU) / 360.0f) * 30.0f) + 30.0f; playFX_26(0, temp, temp2, 50.0f); - script->functionTemp[2].s += 14; - script->functionTemp[1].s += 20; + script->functionTemp[2] += 14; + script->functionTemp[1] += 20; - if (script->functionTemp[1].s >= 360) { + if (script->functionTemp[1] >= 360) { return ApiStatus_DONE2; } } diff --git a/src/battle/star/peach_beam/7997B0.c b/src/battle/star/peach_beam/7997B0.c index e138d8010d..20469f9579 100644 --- a/src/battle/star/peach_beam/7997B0.c +++ b/src/battle/star/peach_beam/7997B0.c @@ -23,13 +23,13 @@ ApiStatus func_802A2468_79AC18(ScriptInstance* script, s32 isInitialCall) { ApiStatus func_802A247C_79AC2C(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 230; + script->functionTemp[0] = 230; } - set_background_color_blend(0, 0, 0, script->functionTemp[0].s); + set_background_color_blend(0, 0, 0, script->functionTemp[0]); - script->functionTemp[0].s -= 5; - if (script->functionTemp[0].s <= 200) { + script->functionTemp[0] -= 5; + if (script->functionTemp[0] <= 200) { set_background_color_blend(0, 0, 0, 200); return ApiStatus_DONE2; } diff --git a/src/battle/star/star_beam/796FC0.c b/src/battle/star/star_beam/796FC0.c index 1661d72b2b..3059f87d14 100644 --- a/src/battle/star/star_beam/796FC0.c +++ b/src/battle/star/star_beam/796FC0.c @@ -23,13 +23,13 @@ ApiStatus func_802A2468_798428(ScriptInstance* script, s32 isInitialCall) { ApiStatus func_802A247C_79843C(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 230; + script->functionTemp[0] = 230; } - set_background_color_blend(0, 0, 0, script->functionTemp[0].s); + set_background_color_blend(0, 0, 0, script->functionTemp[0]); - script->functionTemp[0].s -= 5; - if (script->functionTemp[0].s <= 200) { + script->functionTemp[0] -= 5; + if (script->functionTemp[0] <= 200) { set_background_color_blend(0, 0, 0, 200); return ApiStatus_DONE2; } diff --git a/src/common/FadeBackgroundToBlack.inc.c b/src/common/FadeBackgroundToBlack.inc.c index 67d8105d8a..4b48f3dcb0 100644 --- a/src/common/FadeBackgroundToBlack.inc.c +++ b/src/common/FadeBackgroundToBlack.inc.c @@ -6,11 +6,11 @@ ApiStatus N(FadeBackgroundToBlack)(ScriptInstance* script, s32 isInitialCall) { mdl_set_all_fog_mode(1); *D_801512F0 = 1; set_background_color_blend(0, 0, 0, 0); - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, ((20 - script->functionTemp[0].s) * 10) & 254); - script->functionTemp[0].s--; + set_background_color_blend(0, 0, 0, ((20 - script->functionTemp[0]) * 10) & 254); + script->functionTemp[0]--; do {} while (0); - return (script->functionTemp[0].s == 0) * ApiStatus_DONE2; + return (script->functionTemp[0] == 0) * ApiStatus_DONE2; } diff --git a/src/common/UnkBackgroundFunc.inc.c b/src/common/UnkBackgroundFunc.inc.c index 79f7f8f5f0..d1a046be1a 100644 --- a/src/common/UnkBackgroundFunc.inc.c +++ b/src/common/UnkBackgroundFunc.inc.c @@ -2,13 +2,13 @@ ApiStatus N(UnkBackgroundFunc)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, script->functionTemp[0].s * 10); - script->functionTemp[0].s -= 1; + set_background_color_blend(0, 0, 0, script->functionTemp[0] * 10); + script->functionTemp[0] -= 1; - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { set_background_color_blend(0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/common/UnkBackgroundFunc2.inc.c b/src/common/UnkBackgroundFunc2.inc.c index 16bc9b9f9d..eee284d728 100644 --- a/src/common/UnkBackgroundFunc2.inc.c +++ b/src/common/UnkBackgroundFunc2.inc.c @@ -5,13 +5,13 @@ ApiStatus N(UnkBackgroundFunc2)(ScriptInstance* script, s32 isInitialCall) { mdl_set_all_fog_mode(1); *D_801512F0 = 1; set_background_color_blend(0, 0, 0, 0); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - set_background_color_blend(0, 0, 0, script->functionTemp[0].s); - script->functionTemp[0].s += 10; + set_background_color_blend(0, 0, 0, script->functionTemp[0]); + script->functionTemp[0] += 10; - if (script->functionTemp[0].s >= 230) { + if (script->functionTemp[0] >= 230) { set_background_color_blend(0, 0, 0, 230); return ApiStatus_DONE2; } diff --git a/src/1f580_len_1940.c b/src/encounter_api.c similarity index 95% rename from src/1f580_len_1940.c rename to src/encounter_api.c index 9b85e0af01..9edbe08dcc 100644 --- a/src/1f580_len_1940.c +++ b/src/encounter_api.c @@ -40,16 +40,16 @@ ApiStatus MakeNpcs(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: make_npcs(get_variable(script, *args++), gGameStatusPtr->mapID, get_variable(script, *args++)); - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; break; case 1: - if (gGameState != script->functionTemp[0].s) { + if (gGameState != script->functionTemp[0]) { return ApiStatus_DONE2; } } @@ -57,9 +57,9 @@ ApiStatus MakeNpcs(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_BLOCK; } -INCLUDE_ASM(s32, "1f580_len_1940", RemoveNpc, ScriptInstance* script, s32 isInitialCall); +INCLUDE_ASM(s32, "encounter_api", RemoveNpc, ScriptInstance* script, s32 isInitialCall); -INCLUDE_ASM(s32, "1f580_len_1940", RemoveEncounter, ScriptInstance* script, s32 isInitialCall); +INCLUDE_ASM(s32, "encounter_api", RemoveEncounter, ScriptInstance* script, s32 isInitialCall); ApiStatus GetBattleOutcome(ScriptInstance* script, s32 isInitialCall) { set_variable(script, *script->ptrReadPos, gCurrentEncounter.battleOutcome); @@ -98,7 +98,7 @@ ApiStatus DoNpcDefeat(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_FINISH; } -INCLUDE_ASM(s32, "1f580_len_1940", start_battle); +INCLUDE_ASM(s32, "encounter_api", start_battle); ApiStatus StartBattle(ScriptInstance* script, s32 isInitialCall) { start_battle(script, -1); @@ -110,7 +110,7 @@ ApiStatus StartBattleWith(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE1; } -INCLUDE_ASM(s32, "1f580_len_1940", StartBossBattle, ScriptInstance* script, s32 isInitialCall); +INCLUDE_ASM(s32, "encounter_api", StartBossBattle, ScriptInstance* script, s32 isInitialCall); ApiStatus SetBattleMusic(ScriptInstance* script, s32 isInitialCall) { Bytecode songID = get_variable(script, *script->ptrReadPos); @@ -122,7 +122,7 @@ ApiStatus SetBattleMusic(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "1f580_len_1940", BindNpcAI, ScriptInstance* script, s32 isInitialCall); +INCLUDE_ASM(s32, "encounter_api", BindNpcAI, ScriptInstance* script, s32 isInitialCall); ApiStatus BindNpcIdle(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; @@ -197,7 +197,7 @@ ApiStatus EnableNpcAI(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "1f580_len_1940", SetNpcAux, ScriptInstance* script, s32 isInitialCall); +INCLUDE_ASM(s32, "encounter_api", SetNpcAux, ScriptInstance* script, s32 isInitialCall); ApiStatus BindNpcAux(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; diff --git a/src/104940_len_dc0.c b/src/entity/Block.c similarity index 98% rename from src/104940_len_dc0.c rename to src/entity/Block.c index a50fca252d..5361f4388b 100644 --- a/src/104940_len_dc0.c +++ b/src/entity/Block.c @@ -51,7 +51,7 @@ void entity_block_hit_animate_scale(Entity* entity) { entity_base_block_idle(entity); } -INCLUDE_ASM(s32, "104940_len_dc0", entity_base_block_update_slow_sinking); +INCLUDE_ASM(s32, "entity/Block", entity_base_block_update_slow_sinking); s32 entity_base_block_idle(Entity* entity) { struct802E3650* temp = (struct802E3650*)entity->dataBuf; @@ -319,7 +319,7 @@ s32 entity_block_handle_collision(Entity* entity) { return 1; } #else -INCLUDE_ASM(s32, "104940_len_dc0", entity_block_handle_collision, Entity* entity); +INCLUDE_ASM(s32, "entity/Block", entity_block_handle_collision, Entity* entity); #endif void entity_init_Hammer1Block_normal(Entity* entity) { diff --git a/src/10A230.c b/src/entity/BlueWarpPipe.c similarity index 98% rename from src/10A230.c rename to src/entity/BlueWarpPipe.c index 045bccd829..2215a3817f 100644 --- a/src/10A230.c +++ b/src/entity/BlueWarpPipe.c @@ -145,7 +145,7 @@ void entity_BlueWarpPipe_start_bound_script(Entity* entity) { entity_start_script(entity); } -INCLUDE_ASM(s32, "10A230", entity_BlueWarpPipe_setupGfx); +INCLUDE_ASM(s32, "entity/BlueWarpPipe", entity_BlueWarpPipe_setupGfx); f32 entity_init_BlueWarpPipe(Entity* entity) { struct802E89B0* temp_s0; diff --git a/src/entity/Chest.c b/src/entity/Chest.c new file mode 100644 index 0000000000..9f20fa2418 --- /dev/null +++ b/src/entity/Chest.c @@ -0,0 +1,37 @@ +#include "common.h" + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_adjust_camera); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_reset_camera); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_setupGfx); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_check_opened); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_idle); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_begin_opening); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_open); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_close); + +INCLUDE_ASM(s32, "entity/Chest", entity_GiantChest_hide_effect); + +INCLUDE_ASM(s32, "entity/Chest", entity_GiantChest_open); + +INCLUDE_ASM(s32, "entity/Chest", entity_GiantChest_give_equipment); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_start_bound_script); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_enable_player_input); + +INCLUDE_ASM(s32, "entity/Chest", entity_GiantChest_await_got_item); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_clear_item_id); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_readargs); + +INCLUDE_ASM(s32, "entity/Chest", entity_GiantChest_init); + +INCLUDE_ASM(s32, "entity/Chest", entity_Chest_init); diff --git a/src/105F90.c b/src/entity/HeartBlock.c similarity index 90% rename from src/105F90.c rename to src/entity/HeartBlock.c index e7eb26c2e5..821aed249c 100644 --- a/src/105F90.c +++ b/src/entity/HeartBlock.c @@ -5,9 +5,9 @@ extern u32* D_802EA760; extern StaticEntityData D_802EA7BC; extern UNK_TYPE D_802EB3C0; -INCLUDE_ASM(s32, "105F90", entity_HeartBlockContent_get_previous_yaw); +INCLUDE_ASM(s32, "entity/HeartBlock", entity_HeartBlockContent_get_previous_yaw); -INCLUDE_ASM(s32, "105F90", entity_HeartBlockContent__setupGfx); +INCLUDE_ASM(s32, "entity/HeartBlock", entity_HeartBlockContent__setupGfx); void entity_HeartBlockContent_setupGfx(s32 entityIndex) { entity_HeartBlockContent__setupGfx(entityIndex, &D_0A000808); @@ -52,7 +52,7 @@ void entity_HeartBlockContent__reset(Entity* entity) { entity_HeartBlockContent_set_initial_pos(entity); } -INCLUDE_ASM(s32, "105F90", entity_HeartBlockContent_anim_idle); +INCLUDE_ASM(s32, "entity/HeartBlock", entity_HeartBlockContent_anim_idle); void func_802E4DE0(Entity* entity) { struct802E4B10* temp = entity->dataBuf; @@ -64,13 +64,13 @@ void func_802E4DE0(Entity* entity) { entity->rotation.z = 0.0f; } -INCLUDE_ASM(s32, "105F90", entity_HeartBlockContent__anim_heal); +INCLUDE_ASM(s32, "entity/HeartBlock", entity_HeartBlockContent__anim_heal); void entity_HeartBlock_idle(Entity* entity) { entity_base_block_idle(entity); } -INCLUDE_ASM(s32, "105F90", entity_HeartBlockContent_anim_beating); +INCLUDE_ASM(s32, "entity/HeartBlock", entity_HeartBlockContent_anim_beating); void entity_HeartBlockContent_init(Entity* entity) { entity_HeartBlockContent_set_initial_pos(entity); diff --git a/src/105700_len_2130.c b/src/entity/ItemBlock.c similarity index 97% rename from src/105700_len_2130.c rename to src/entity/ItemBlock.c index 641f367b68..13f1b3a480 100644 --- a/src/105700_len_2130.c +++ b/src/entity/ItemBlock.c @@ -30,9 +30,9 @@ void entity_HiddenItemBlock_idle(Entity* entity) { } } -INCLUDE_ASM(s32, "105700_len_2130", entity_HitItemBlock_appear); +INCLUDE_ASM(s32, "entity/ItemBlock", entity_HitItemBlock_appear); -INCLUDE_ASM(void, "105700_len_2130", entity_ItemBlock_spawn_item, Entity* entity); +INCLUDE_ASM(void, "entity/ItemBlock", entity_ItemBlock_spawn_item, Entity* entity); void entity_TriggerBlock_start_bound_script_2(Entity* entity) { entity_start_script(entity); diff --git a/src/102610_len_2330.c b/src/entity/SaveBlock.c similarity index 97% rename from src/102610_len_2330.c rename to src/entity/SaveBlock.c index 4885956451..c5b4a21be8 100644 --- a/src/102610_len_2330.c +++ b/src/entity/SaveBlock.c @@ -19,7 +19,7 @@ s32 entity_can_collide_with_jumping_player(Shadow* shadow) { return FALSE; } -INCLUDE_ASM(s32, "102610_len_2330", entity_SaveBlock_setupGfx); +INCLUDE_ASM(s32, "entity/SaveBlock", entity_SaveBlock_setupGfx); void entity_SaveBlock_idle(Entity* entity) { struct802E10F4* temp; diff --git a/src/10A8D0.c b/src/entity/Signpost.c similarity index 100% rename from src/10A8D0.c rename to src/entity/Signpost.c diff --git a/src/entity/SimpleSpring.c b/src/entity/SimpleSpring.c new file mode 100644 index 0000000000..62dd89acf6 --- /dev/null +++ b/src/entity/SimpleSpring.c @@ -0,0 +1,28 @@ +#include "common.h" + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_ScriptSpring_idle); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_SimpleSpring_idle); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_SimpleSpring_set_jump_params); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_SimpleSpring_enable_player_input); + +void entity_ScriptSpring_init(void) { +} + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_SimpleSpring_init); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_setupGfx); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_set_ispy_notification); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_hide); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_idle); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_flip_over); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_is_item_on_top); + +INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_init); diff --git a/src/106EF0.c b/src/entity/SuperBlock.c similarity index 97% rename from src/106EF0.c rename to src/entity/SuperBlock.c index 07c7e139ed..cf334cee78 100644 --- a/src/106EF0.c +++ b/src/entity/SuperBlock.c @@ -68,7 +68,7 @@ void entity_SuperBlock_HitEffect_attach_to_parent(Entity* entity) { } // display list func -INCLUDE_ASM(s32, "106EF0", entity_SuperBlock_HitEffect_setupGfx); +INCLUDE_ASM(s32, "entity/SuperBlock", entity_SuperBlock_HitEffect_setupGfx); void entity_SuperBlock_HitEffect_idle(Entity* entity) { struct802E4B10* temp_s0 = entity->dataBuf; diff --git a/src/102C80.c b/src/entity/Switch.c similarity index 97% rename from src/102C80.c rename to src/entity/Switch.c index d4f2cae02f..a7c6a4086d 100644 --- a/src/102C80.c +++ b/src/entity/Switch.c @@ -311,7 +311,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { } } #else -INCLUDE_ASM(s32, "102C80", entity_RedSwitch_animate_scale, Entity* entity); +INCLUDE_ASM(s32, "entity/Switch", entity_RedSwitch_animate_scale, Entity* entity); #endif void entity_base_switch_start_bound_script(Entity* entity) { @@ -462,7 +462,7 @@ void entity_base_switch_animate_scale(Entity* entity) { } } #else -INCLUDE_ASM(void, "102C80", entity_base_switch_animate_scale, Entity* entity); +INCLUDE_ASM(void, "entity/Switch", entity_base_switch_animate_scale, Entity* entity); #endif void entity_base_switch_init(Entity* entity) { @@ -514,9 +514,9 @@ void entity_BrickBlock_idle(Entity* entity) { } -INCLUDE_ASM(void, "102C80", entity_shattering_init_pieces, Entity* entity, void* arg1, void* arg2); +INCLUDE_ASM(void, "entity/Switch", entity_shattering_init_pieces, Entity* entity, void* arg1, void* arg2); -INCLUDE_ASM(void, "102C80", entity_shattering_idle, Entity* entity); +INCLUDE_ASM(void, "entity/Switch", entity_shattering_idle, Entity* entity); #ifdef NON_MATCHING // display list issues @@ -570,5 +570,5 @@ void entity_shattering_setupGfx(s32 entityIndex) { gMasterGfxPos = temp_s2; } #else -INCLUDE_ASM(s32, "102C80", entity_shattering_setupGfx); +INCLUDE_ASM(s32, "entity/Switch", entity_shattering_setupGfx); #endif diff --git a/src/109660_len_1270.c b/src/entity/WoodenCrate.c similarity index 91% rename from src/109660_len_1270.c rename to src/entity/WoodenCrate.c index 8d86dd0346..f757356f22 100644 --- a/src/109660_len_1270.c +++ b/src/entity/WoodenCrate.c @@ -18,7 +18,7 @@ typedef struct struct802E7DE0 { /* 0x304 */ f32 unk_304[36]; } struct802E7DE0; -INCLUDE_ASM(s32, "109660_len_1270", entity_WoodenCrate_init_fragments); +INCLUDE_ASM(s32, "entity/WoodenCrate", entity_WoodenCrate_init_fragments); typedef struct struct802E7F40 { /* 0x00 */ s32 unk_00; @@ -44,9 +44,9 @@ void entity_WoodenCrate_reset_fragments(Entity* entity) { entity_WoodenCrate_init_fragments(entity, &D_0A004350, &D_0A0026F0); } -INCLUDE_ASM(s32, "109660_len_1270", entity_WoodenCrate_update_fragments); +INCLUDE_ASM(s32, "entity/WoodenCrate", entity_WoodenCrate_update_fragments); -INCLUDE_ASM(s32, "109660_len_1270", entity_WoodenCrate_setupGfx); +INCLUDE_ASM(s32, "entity/WoodenCrate", entity_WoodenCrate_setupGfx); s32 entity_WoodenCrate_idle(Entity* entity) { PlayerStatus* playerStatus = &gPlayerStatus; diff --git a/src/evt/f8f60_len_1560.c b/src/evt/f8f60_len_1560.c index 39e51bf3c1..c5f98de36d 100644 --- a/src/evt/f8f60_len_1560.c +++ b/src/evt/f8f60_len_1560.c @@ -86,9 +86,9 @@ ApiStatus AwaitPlayerApproach(ScriptInstance* script, s32 isInitialCall) { Bytecode* ptrReadPos = script->ptrReadPos; PlayerStatus* playerStatus = &gPlayerStatus; - s32* targetX = &script->functionTemp[0].s; - s32* targetZ = &script->functionTemp[1].s; - s32* distanceRequired = &script->functionTemp[2].s; + s32* targetX = &script->functionTemp[0]; + s32* targetZ = &script->functionTemp[1]; + s32* distanceRequired = &script->functionTemp[2]; f32 distance; @@ -114,9 +114,9 @@ ApiStatus IsPlayerWithin(ScriptInstance* script, s32 isInitialCall) { Bytecode* ptrReadPos = script->ptrReadPos; PlayerStatus* playerStatus = &gPlayerStatus; - s32* targetX = &script->functionTemp[0].s; - s32* targetZ = &script->functionTemp[1].s; - s32* distanceRequired = &script->functionTemp[2].s; + s32* targetX = &script->functionTemp[0]; + s32* targetZ = &script->functionTemp[1]; + s32* distanceRequired = &script->functionTemp[2]; f32 distance; Bytecode outVar = SI_VAR(0); @@ -145,9 +145,9 @@ ApiStatus AwaitPlayerLeave(ScriptInstance* script, s32 isInitialCall) { Bytecode* ptrReadPos = script->ptrReadPos; PlayerStatus* playerStatus = &gPlayerStatus; - s32* targetX = &script->functionTemp[0].s; - s32* targetZ = &script->functionTemp[1].s; - s32* distanceRequired = &script->functionTemp[2].s; + s32* targetX = &script->functionTemp[0]; + s32* targetZ = &script->functionTemp[1]; + s32* distanceRequired = &script->functionTemp[2]; f32 distance; @@ -189,8 +189,8 @@ ApiStatus AddVectorPolar(ScriptInstance* script, s32 isInitialCall) { } ApiStatus func_802D4BDC(ScriptInstance* script, s32 initialCall) { - s32* t0 = &script->functionTemp[0].s; - s32* t1 = &script->functionTemp[1].s; + s32* t0 = &script->functionTemp[0]; + s32* t1 = &script->functionTemp[1]; s32 t1v; if (initialCall) { @@ -217,8 +217,8 @@ ApiStatus func_802D4BDC(ScriptInstance* script, s32 initialCall) { } ApiStatus func_802D4C4C(ScriptInstance* script, s32 initialCall) { - s32* t0 = &script->functionTemp[0].s; - s32* t1 = &script->functionTemp[1].s; + s32* t0 = &script->functionTemp[0]; + s32* t1 = &script->functionTemp[1]; s32 t1v; if (initialCall) { diff --git a/src/evt/fa4c0_len_3bf0.c b/src/evt/fa4c0_len_3bf0.c index 4d6ff689ba..44dc782900 100644 --- a/src/evt/fa4c0_len_3bf0.c +++ b/src/evt/fa4c0_len_3bf0.c @@ -501,16 +501,16 @@ ApiStatus ShowGotItem(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: - script->functionTemp[1].s = init_got_item(get_variable(script, *args++), get_variable(script, *args++), *args++); - script->functionTemp[0].s = 1; + script->functionTemp[1] = init_got_item(get_variable(script, *args++), get_variable(script, *args++), *args++); + script->functionTemp[0] = 1; break; case 1: - if (get_item_entity(script->functionTemp[1].s) == NULL) { + if (get_item_entity(script->functionTemp[1]) == NULL) { return ApiStatus_DONE2; } } diff --git a/src/evt/fx_api.c b/src/evt/fx_api.c index 87fdb66f3d..0c542c2fcc 100644 --- a/src/evt/fx_api.c +++ b/src/evt/fx_api.c @@ -75,19 +75,19 @@ ApiStatus func_802D7BA4(ScriptInstance* script, s32 isInitialCall) { f32 t1; if (isInitialCall) { - script->functionTemp[0].s = var6; + script->functionTemp[0] = var6; get_screen_overlay_params(1, &t0, &t1); - script->functionTemp[1].s = t1; + script->functionTemp[1] = t1; set_screen_overlay_center(1, 0, var1, var2); set_screen_overlay_center(1, 1, var3, var4); } get_screen_overlay_params(1, &t0, &t1); - temp = (script->functionTemp[1].s - var5) * script->functionTemp[0].s; + temp = (script->functionTemp[1] - var5) * script->functionTemp[0]; set_screen_overlay_params_back(12, (temp / var6) + var5); - script->functionTemp[0].s--; - if (script->functionTemp[0].s < 0) { + script->functionTemp[0]--; + if (script->functionTemp[0] < 0) { set_screen_overlay_params_back(12, var5); return ApiStatus_DONE2; } diff --git a/src/evt/msg_api.c b/src/evt/msg_api.c index 4a581a6548..4c5eb1d98b 100644 --- a/src/evt/msg_api.c +++ b/src/evt/msg_api.c @@ -119,7 +119,7 @@ ApiStatus ShowChoice(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { s32 stringID = get_variable(script, *args++); - script->functionTemp[1].s = 0; + script->functionTemp[1] = 0; D_802DB268 = msg_get_printer_for_string(stringID, &script->functionTemp[1]); } @@ -130,7 +130,7 @@ ApiStatus ShowChoice(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE1; } - return script->functionTemp[1].s == 1; + return script->functionTemp[1] == 1; } ApiStatus CloseChoice(ScriptInstance* script, s32 isInitialCall) { diff --git a/src/evt/npc_api.c b/src/evt/npc_api.c index fa9ee143da..b147494884 100644 --- a/src/evt/npc_api.c +++ b/src/evt/npc_api.c @@ -233,10 +233,10 @@ ApiStatus NpcMoveTo(ScriptInstance* script, s32 isInitialCall) { f32 moveSpeed; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { NpcID npcID = get_variable(script, *args++); f32 targetX = get_variable(script, *args++); f32 targetZ = get_variable(script, *args++); @@ -247,7 +247,7 @@ ApiStatus NpcMoveTo(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } - script->functionTemp[1].s = (s32)npc; + script->functionTemp[1] = (s32)npc; npc->moveToPos.x = targetX; npc->moveToPos.z = targetZ; npc->duration = duration; @@ -261,10 +261,10 @@ ApiStatus NpcMoveTo(ScriptInstance* script, s32 isInitialCall) { if (npc->duration == 0) { npc->duration = 1; } - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } - npc = (Npc*)script->functionTemp[1].s; + npc = (Npc*)script->functionTemp[1]; npc->yaw = atan2(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); @@ -289,14 +289,14 @@ ApiStatus NpcMoveTo(ScriptInstance* script, s32 isInitialCall) { ApiStatus _npc_jump_to(ScriptInstance* script, s32 isInitialCall, s32 snapYaw) { Bytecode* args = script->ptrReadPos; - f32* yaw = &script->functionTemp[2].f; + f32* yaw = (f32*) &script->functionTemp[2]; Npc* npc; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { NpcID npcID = get_variable(script, *args++); f32 xTemp = get_variable(script, *args++); f32 yTemp = get_variable(script, *args++); @@ -310,7 +310,7 @@ ApiStatus _npc_jump_to(ScriptInstance* script, s32 isInitialCall, s32 snapYaw) { return ApiStatus_DONE2; } - script->functionTemp[1].s = (s32)npc; + script->functionTemp[1] = (s32)npc; npc->moveToPos.x = xTemp; npc->moveToPos.y = yTemp; npc->moveToPos.z = zTemp; @@ -335,10 +335,10 @@ ApiStatus _npc_jump_to(ScriptInstance* script, s32 isInitialCall, s32 snapYaw) { npc->flags |= 0x800; npc->jumpVelocity = (npc->jumpScale * npc->duration * 0.5f) + (yTemp / npc->duration); - script->functionTemp[0].s =1; + script->functionTemp[0] =1; } - npc = (Npc*)script->functionTemp[1].s; + npc = (Npc*)script->functionTemp[1]; npc_move_heading(npc, npc->moveSpeed, *yaw); npc->pos.y += npc->jumpVelocity; @@ -380,13 +380,13 @@ ApiStatus NpcFlyTo(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } - script->functionTemp[1].s = (s32)npc; + script->functionTemp[1] = (s32)npc; npc->moveToPos.x = get_float_variable(script, *args++); npc->moveToPos.y = get_float_variable(script, *args++); npc->moveToPos.z = get_float_variable(script, *args++); script->varTable[6] = get_variable(script, *args++); - script->functionTemp[2].s = get_variable(script, *args++); - script->functionTemp[3].s = get_variable(script, *args++); + script->functionTemp[2] = get_variable(script, *args++); + script->functionTemp[3] = get_variable(script, *args++); npc->duration = 0; *outX = npc->pos.x; *outY = npc->pos.y; @@ -402,10 +402,10 @@ ApiStatus NpcFlyTo(ScriptInstance* script, s32 isInitialCall) { } } - npc = (Npc*)script->functionTemp[1].s; - npc->pos.x = update_lerp(script->functionTemp[3].s, *outX, npc->moveToPos.x, npc->duration, script->varTable[6]); - npc->pos.y = update_lerp(script->functionTemp[3].s, *outY, npc->moveToPos.y, npc->duration, script->varTable[6]); - npc->pos.z = update_lerp(script->functionTemp[3].s, *outZ, npc->moveToPos.z, npc->duration, script->varTable[6]); + npc = (Npc*)script->functionTemp[1]; + npc->pos.x = update_lerp(script->functionTemp[3], *outX, npc->moveToPos.x, npc->duration, script->varTable[6]); + npc->pos.y = update_lerp(script->functionTemp[3], *outY, npc->moveToPos.y, npc->duration, script->varTable[6]); + npc->pos.z = update_lerp(script->functionTemp[3], *outZ, npc->moveToPos.z, npc->duration, script->varTable[6]); npc->duration++; if (npc->duration >= script->varTable[6]) { @@ -424,14 +424,14 @@ ApiStatus NpcFlyTo(ScriptInstance* script, s32 isInitialCall) { } yDelta = sin_deg((1.0 - (dist / npc->planarFlyDist)) * 180.0); - if (script->functionTemp[2].s == 0) { + if (script->functionTemp[2] == 0) { yDelta = 0.0f; } - if (script->functionTemp[2].s < 0) { - yDelta = -yDelta * -script->functionTemp[2].s; + if (script->functionTemp[2] < 0) { + yDelta = -yDelta * -script->functionTemp[2]; } - if (script->functionTemp[2].s > 0) { - yDelta *= script->functionTemp[2].s; + if (script->functionTemp[2] > 0) { + yDelta *= script->functionTemp[2]; } npc->pos.y += yDelta; return ApiStatus_BLOCK; @@ -467,9 +467,9 @@ ApiStatus SetNpcYaw(ScriptInstance* script, s32 isInitialCall) { ApiStatus InterpNpcYaw(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; Bytecode* args = script->ptrReadPos; - f32* t1 = &script->functionTemp[1].f; - f32* t2 = &script->functionTemp[2].f; - s32* t3 = &script->functionTemp[3].s; + f32* t1 = (f32*) &script->functionTemp[1]; + f32* t2 = (f32*) &script->functionTemp[2]; + s32* t3 = &script->functionTemp[3]; Npc* npc; if (isInitialCall) { @@ -482,7 +482,7 @@ ApiStatus InterpNpcYaw(ScriptInstance* script, s32 isInitialCall) { *t1 = npc->yaw; *t2 = get_variable(script, *args++) - *t1; - script->functionTemp[0].s = (s32)npc; + script->functionTemp[0] = (s32)npc; *t3 = get_variable(script, *args++); if (*t3 == 0) { @@ -500,7 +500,7 @@ ApiStatus InterpNpcYaw(ScriptInstance* script, s32 isInitialCall) { } } - npc = (Npc*)script->functionTemp[0].s; + npc = (Npc*)script->functionTemp[0]; if (*t3 > 0) { npc->duration++; npc->yaw = *t1 + ((*t2 * npc->duration) / *t3); @@ -515,9 +515,9 @@ ApiStatus InterpNpcYaw(ScriptInstance* script, s32 isInitialCall) { ApiStatus NpcFacePlayer(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; Bytecode* args = script->ptrReadPos; - f32* t1 = &script->functionTemp[1].f; - f32* t2 = &script->functionTemp[2].f; - s32* t3 = &script->functionTemp[3].s; + f32* t1 = (f32*) &script->functionTemp[1]; + f32* t2 = (f32*) &script->functionTemp[2]; + s32* t3 = &script->functionTemp[3]; Npc* npc; if (isInitialCall) { @@ -530,7 +530,7 @@ ApiStatus NpcFacePlayer(ScriptInstance* script, s32 isInitialCall) { *t1 = npc->yaw; *t2 = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z) - *t1; - script->functionTemp[0].s = (s32)npc; + script->functionTemp[0] = (s32)npc; *t3 = get_variable(script, *args++); npc->duration = 0; @@ -542,7 +542,7 @@ ApiStatus NpcFacePlayer(ScriptInstance* script, s32 isInitialCall) { } } - npc = (Npc*)script->functionTemp[0].s; + npc = (Npc*)script->functionTemp[0]; if (*t3 > 0) { npc->duration++; npc->yaw = *t1 + ((*t2 * npc->duration) / *t3); @@ -556,9 +556,9 @@ ApiStatus NpcFacePlayer(ScriptInstance* script, s32 isInitialCall) { ApiStatus NpcFaceNpc(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; - f32* t1 = &script->functionTemp[1].f; - f32* t2 = &script->functionTemp[2].f; - s32* t3 = &script->functionTemp[3].s; + f32* t1 = (f32*) &script->functionTemp[1]; + f32* t2 = (f32*) &script->functionTemp[2]; + s32* t3 = &script->functionTemp[3]; Npc* npc; Npc* npc2; @@ -578,7 +578,7 @@ ApiStatus NpcFaceNpc(ScriptInstance* script, s32 isInitialCall) { *t1 = npc2->yaw; *t2 = atan2(npc2->pos.x, npc2->pos.z, npc->pos.x, npc->pos.z) - *t1; - script->functionTemp[0].s = (s32)npc2; + script->functionTemp[0] = (s32)npc2; *t3 = get_variable(script, *args++); npc2->duration = 0; @@ -590,7 +590,7 @@ ApiStatus NpcFaceNpc(ScriptInstance* script, s32 isInitialCall) { } } - npc2 = (Npc*)script->functionTemp[0].s; + npc2 = (Npc*)script->functionTemp[0]; if (*t3 > 0) { npc2->duration++; npc2->yaw = *t1 + ((*t2 * npc2->duration) / *t3); diff --git a/src/evt/player_api.c b/src/evt/player_api.c index 3ed49bbf2e..3f1e8dbfd2 100644 --- a/src/evt/player_api.c +++ b/src/evt/player_api.c @@ -135,22 +135,22 @@ ApiStatus PlayerMoveTo(ScriptInstance* script, s32 isInitialCall) { f32 targetZ = get_variable(script, *args++); f32 moveSpeed; - script->functionTemp[0].s = get_variable(script, *args++); + script->functionTemp[0] = get_variable(script, *args++); playerStatus->targetYaw = atan2(playerStatus->position.x, playerStatus->position.z, targetX, targetZ); - if (script->functionTemp[0].s == 0) { - script->functionTemp[0].s = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, + if (script->functionTemp[0] == 0) { + script->functionTemp[0] = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, targetZ) / playerNpc->moveSpeed; moveSpeed = playerNpc->moveSpeed; } else { - moveSpeed = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, targetZ) / script->functionTemp[0].s; + moveSpeed = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, targetZ) / script->functionTemp[0]; } - move_player(script->functionTemp[0].s, playerStatus->targetYaw, moveSpeed); + move_player(script->functionTemp[0], playerStatus->targetYaw, moveSpeed); } // functionTemp 0 is the time left - script->functionTemp[0].s--; - return script->functionTemp[0].s < 0; + script->functionTemp[0]--; + return script->functionTemp[0] < 0; } ApiStatus func_802D1270(ScriptInstance* script, s32 isInitialCall) { @@ -166,15 +166,15 @@ ApiStatus func_802D1270(ScriptInstance* script, s32 isInitialCall) { playerStatus->targetYaw = atan2(playerStatus->position.x, playerStatus->position.z, targetX, targetZ); dist = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, targetZ); - script->functionTemp[0].s = dist / var3; - moveSpeed = dist / script->functionTemp[0].s; + script->functionTemp[0] = dist / var3; + moveSpeed = dist / script->functionTemp[0]; - move_player(script->functionTemp[0].s, playerStatus->targetYaw, moveSpeed); + move_player(script->functionTemp[0], playerStatus->targetYaw, moveSpeed); } // functionTemp 0 is the time left - script->functionTemp[0].s--; - return (script->functionTemp[0].s < 0) * ApiStatus_DONE2; + script->functionTemp[0]--; + return (script->functionTemp[0] < 0) * ApiStatus_DONE2; } ApiStatus func_802D1380(ScriptInstance* script, s32 isInitialCall) { @@ -215,10 +215,10 @@ s32 player_jump(ScriptInstance* script, s32 isInitialCall, s32 mode) { f32 dist; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { xTemp = get_variable(script, *args++); yTemp = get_variable(script, *args++); zTemp = get_variable(script, *args++); @@ -263,7 +263,7 @@ s32 player_jump(ScriptInstance* script, s32 isInitialCall, s32 mode) { suggest_player_anim_clearUnkFlag(animID); sfx_play_sound_at_player(SOUND_JUMP_2081, 0); } - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } npc_move_heading(playerNpc, playerNpc->moveSpeed, playerNpc->yaw); @@ -342,9 +342,9 @@ ApiStatus PlayerJump2(ScriptInstance* script, s32 isInitialCall) { ApiStatus InterpPlayerYaw(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; PlayerStatus* playerStatus = &gPlayerStatus; - f32* initialYaw = &script->functionTemp[1].f; - f32* deltaYaw = &script->functionTemp[2].f; - s32* time = &script->functionTemp[3].s; + f32* initialYaw = (f32*) &script->functionTemp[1]; + f32* deltaYaw = (f32*) &script->functionTemp[2]; + s32* time = &script->functionTemp[3]; if (isInitialCall) { playerNpc->yaw = playerStatus->targetYaw; @@ -380,9 +380,9 @@ ApiStatus InterpPlayerYaw(ScriptInstance* script, s32 isInitialCall) { ApiStatus PlayerFaceNpc(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; s32* args = script->ptrReadPos; - f32* playerTargetYaw = &script->functionTemp[1].f; - f32* angle = &script->functionTemp[2].f; - s32* ft3 = &script->functionTemp[3].s; + f32* playerTargetYaw = (f32*) &script->functionTemp[1]; + f32* angle = (f32*) &script->functionTemp[2]; + s32* ft3 = &script->functionTemp[3]; if (isInitialCall) { NpcID npcID = get_variable(script, *args++); @@ -701,9 +701,9 @@ ApiStatus func_802D286C(ScriptInstance* script, s32 isInitialCall) { ApiStatus func_802D2884(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; PlayerStatus* playerStatus = &gPlayerStatus; - f32* ft1 = &script->functionTemp[1].f; - f32* angle = &script->functionTemp[2].f; - s32* ft3 = &script->functionTemp[3].s; + f32* ft1 = (f32*) &script->functionTemp[1]; + f32* angle = (f32*) &script->functionTemp[2]; + s32* ft3 = &script->functionTemp[3]; if (isInitialCall) { f32 x = get_float_variable(script, *args++); @@ -1070,10 +1070,10 @@ ApiStatus VirtualEntityMoveTo(ScriptInstance* script, s32 isInitialCall) { VirtualEntity* virtualEntity; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { s32 index = get_variable(script, *args++); f32 xTemp = get_variable(script, *args++); f32 yTemp = get_variable(script, *args++); @@ -1083,7 +1083,7 @@ ApiStatus VirtualEntityMoveTo(ScriptInstance* script, s32 isInitialCall) { f32 goalPosZ; virtualEntity = (*D_802DB7C0)[index]; - script->functionTemp[1].s = index; + script->functionTemp[1] = index; virtualEntity->goalPos.x = xTemp; virtualEntity->goalPos.y = yTemp; @@ -1105,10 +1105,10 @@ ApiStatus VirtualEntityMoveTo(ScriptInstance* script, s32 isInitialCall) { virtualEntity->moveSpeed = virtualEntity->moveDist / virtualEntity->moveTime; } - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } - virtualEntity = (*D_802DB7C0)[script->functionTemp[1].s]; + virtualEntity = (*D_802DB7C0)[script->functionTemp[1]]; virtual_entity_move_polar(virtualEntity, virtualEntity->moveSpeed, virtualEntity->moveAngle); virtualEntity->moveTime--; @@ -1136,10 +1136,10 @@ ApiStatus VirtualEntityJumpTo(ScriptInstance* script, s32 isInitialCall) { f32 goalPosZ; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { index = get_variable(script, *args++); xTemp = get_variable(script, *args++); yTemp = get_variable(script, *args++); @@ -1147,7 +1147,7 @@ ApiStatus VirtualEntityJumpTo(ScriptInstance* script, s32 isInitialCall) { moveTime = get_variable(script, *args++); virtualEntity = (*D_802DB7C0)[index]; - script->functionTemp[1].s = index; + script->functionTemp[1] = index; virtualEntity->goalPos.x = xTemp; virtualEntity->goalPos.y = yTemp; @@ -1175,10 +1175,10 @@ ApiStatus VirtualEntityJumpTo(ScriptInstance* script, s32 isInitialCall) { virtualEntity->jumpVelocity = (virtualEntity->jumpGravity * virtualEntity->moveTime / 2) + (goalPosY / virtualEntity->moveTime); - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } - virtualEntity = (*D_802DB7C0)[script->functionTemp[1].s]; + virtualEntity = (*D_802DB7C0)[script->functionTemp[1]]; virtualEntity->pos.y += virtualEntity->jumpVelocity; virtualEntity->jumpVelocity -= virtualEntity->jumpGravity; @@ -1203,15 +1203,15 @@ ApiStatus VirtualEntityLandJump(ScriptInstance* script, s32 isInitialCall) { VirtualEntity* virtualEntity; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == 0) { - script->functionTemp[1].s = get_variable(script, *args++); - script->functionTemp[0].s = 1; + if (script->functionTemp[0] == 0) { + script->functionTemp[1] = get_variable(script, *args++); + script->functionTemp[0] = 1; } - virtualEntity = (*D_802DB7C0)[script->functionTemp[1].s]; + virtualEntity = (*D_802DB7C0)[script->functionTemp[1]]; virtualEntity->pos.y += virtualEntity->jumpVelocity; virtualEntity->jumpVelocity -= virtualEntity->jumpGravity; diff --git a/src/evt/si.c b/src/evt/si.c index ee3a0daba8..3700ab67fd 100644 --- a/src/evt/si.c +++ b/src/evt/si.c @@ -88,32 +88,32 @@ ApiStatus si_handle_wait(ScriptInstance* script) { Bytecode* ptrReadPos = script->ptrReadPos; if (!script->blocked) { - script->functionTemp[0].s = get_variable(script, *ptrReadPos); + script->functionTemp[0] = get_variable(script, *ptrReadPos); script->blocked = 1; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { return ApiStatus_DONE2; } - script->functionTemp[0].s -= 1; - return !script->functionTemp[0].s; + script->functionTemp[0] -= 1; + return !script->functionTemp[0]; } ApiStatus si_handle_wait_seconds(ScriptInstance* script) { Bytecode* ptrReadPos = script->ptrReadPos; if (!script->blocked) { - script->functionTemp[0].s = get_float_variable(script, *ptrReadPos) * 30.0f + 0.5; + script->functionTemp[0] = get_float_variable(script, *ptrReadPos) * 30.0f + 0.5; script->blocked = 1; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { return ApiStatus_DONE2; } - script->functionTemp[0].s--; - return !script->functionTemp[0].s; + script->functionTemp[0]--; + return !script->functionTemp[0]; } ApiStatus si_handle_if_equal(ScriptInstance* script) { diff --git a/src/world/area_arn/arn_02/events.c b/src/world/area_arn/arn_02/events.c index a670ede37d..a2ab056f83 100644 --- a/src/world/area_arn/arn_02/events.c +++ b/src/world/area_arn/arn_02/events.c @@ -237,18 +237,18 @@ void N(func_802401D4_BDD384)(ScriptInstance* script, NpcAISettings* aiSettings, Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { npc->currentAnim.w = enemy->animList[9]; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->duration = 12; - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } #include "world/common/UnkNpcAIFunc21.inc.c" @@ -282,7 +282,7 @@ void N(func_80240694_BDD844)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration < 15) { npc->duration = 15; } - script->functionTemp[0].s = 0x16; + script->functionTemp[0] = 0x16; } } @@ -300,7 +300,7 @@ void N(func_80240984_BDDB34)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } @@ -332,7 +332,7 @@ s32 N(func_80240C90_BDDE40)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { @@ -349,26 +349,26 @@ s32 N(func_80240C90_BDDE40)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - if ((u32)script->functionTemp[0].s - 12 < 3 && N(func_80240000_BDD1B0)(script, npcAISettings, territoryPtr)) { - script->functionTemp[0].s = 20; + if ((u32)script->functionTemp[0] - 12 < 3 && N(func_80240000_BDD1B0)(script, npcAISettings, territoryPtr)) { + script->functionTemp[0] = 20; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc18)(script, npcAISettings, territoryPtr); case 1: N(func_802401D4_BDD384)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 2) { + if (script->functionTemp[0] != 2) { return ApiStatus_BLOCK; } case 2: N(UnkNpcAIFunc21)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 3) { + if (script->functionTemp[0] != 3) { return ApiStatus_BLOCK; } case 3: N(UnkNpcAIFunc20)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 4) { + if (script->functionTemp[0] != 4) { return ApiStatus_BLOCK; } case 4: @@ -378,18 +378,18 @@ s32 N(func_80240C90_BDDE40)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_BLOCK; case 12: func_80049F7C(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { return ApiStatus_BLOCK; } case 13: func_8004A124(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 14) { + if (script->functionTemp[0] != 14) { return ApiStatus_BLOCK; } case 14: npc->duration--; if (npc->duration == 0) { - script->functionTemp[0].s = 40; + script->functionTemp[0] = 40; } return ApiStatus_BLOCK; case 20: @@ -402,7 +402,7 @@ s32 N(func_80240C90_BDDE40)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_BLOCK; case 40: N(func_80240984_BDDB34)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 41) { + if (script->functionTemp[0] != 41) { return ApiStatus_BLOCK; } case 41: @@ -412,7 +412,7 @@ s32 N(func_80240C90_BDDE40)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc19)(script, npcAISettings, territoryPtr); case 51: N(UnkNpcAIFunc17)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 52) { + if (script->functionTemp[0] != 52) { return ApiStatus_BLOCK; } case 52: diff --git a/src/world/area_arn/arn_03/events.c b/src/world/area_arn/arn_03/events.c index 1cdbdda191..30f78d5851 100644 --- a/src/world/area_arn/arn_03/events.c +++ b/src/world/area_arn/arn_03/events.c @@ -900,7 +900,7 @@ ApiStatus N(func_80240B94_BDF924)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -911,11 +911,11 @@ ApiStatus N(func_80240B94_BDF924)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -929,7 +929,7 @@ ApiStatus N(func_80240B94_BDF924)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr); case 1: @@ -974,18 +974,18 @@ void N(func_80240E90_BDFC20)(ScriptInstance* script, NpcAISettings* aiSettings, posX = npc->pos.x; posZ = npc->pos.z; - temp_f22 = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).x; - temp_f20 = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).z; + temp_f22 = (*(enemy->territory->patrol.points + script->functionTemp[2])).x; + temp_f20 = (*(enemy->territory->patrol.points + script->functionTemp[2])).z; npc->yaw = atan2(posX, posZ, temp_f22, temp_f20); npc_move_heading(npc, npc->moveSpeed, npc->yaw); posX = npc->pos.x; - posY = npc->pos.y + (*(enemy->territory->patrol.points + script->functionTemp[2].s)).y; + posY = npc->pos.y + (*(enemy->territory->patrol.points + script->functionTemp[2])).y; posZ = npc->pos.z; posW = 1000.0f; npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW); - posY += (*(enemy->territory->patrol.points + script->functionTemp[2].s)).y; + posY += (*(enemy->territory->patrol.points + script->functionTemp[2])).y; posW = posY - npc->pos.y; if (posW > 2.0) { npc->pos.y += 2.0; @@ -997,7 +997,7 @@ void N(func_80240E90_BDFC20)(ScriptInstance* script, NpcAISettings* aiSettings, posW = dist2D(npc->pos.x, npc->pos.z, temp_f22, temp_f20); if (!(posW > npc->moveSpeed)) { - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } } @@ -1007,12 +1007,12 @@ void N(func_80241068_BDFDF8)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration < 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s >= 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] >= 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); } else { - script->functionTemp[0].s = 4; + script->functionTemp[0] = 4; npc->currentAnim.w = enemy->animList[0]; } } @@ -1036,12 +1036,12 @@ ApiStatus N(func_8024113C_BDFECC)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->flags &= ~0x800; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr); case 1: diff --git a/src/world/area_arn/arn_04/events.c b/src/world/area_arn/arn_04/events.c index 7f39893f61..c628f45cc1 100644 --- a/src/world/area_arn/arn_04/events.c +++ b/src/world/area_arn/arn_04/events.c @@ -284,20 +284,20 @@ void N(func_80240158_BE3908)(ScriptInstance* script, NpcAISettings* aiSettings, s32 var; if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } if (npc->turnAroundYawAdjustment == 0) { @@ -307,19 +307,19 @@ void N(func_80240158_BE3908)(ScriptInstance* script, NpcAISettings* aiSettings, func_8003D660(npc, 1); } - x = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).x; - z = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).z; + x = (*(enemy->territory->patrol.points + script->functionTemp[2])).x; + z = (*(enemy->territory->patrol.points + script->functionTemp[2])).z; npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || - (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { - script->functionTemp[0].s = 4; + (aiSettings->waitTime <= 0) || (script->functionTemp[1] == 0)) { + script->functionTemp[0] = 4; } if (rand_int(10000) % 100 < aiSettings->moveTime) { - script->functionTemp[0].s = 4; + script->functionTemp[0] = 4; } } } @@ -362,7 +362,7 @@ ApiStatus N(func_80240B94_BE4344)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -373,11 +373,11 @@ ApiStatus N(func_80240B94_BE4344)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -391,7 +391,7 @@ ApiStatus N(func_80240B94_BE4344)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, aiSettings, territoryPtr); case 1: @@ -507,8 +507,8 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { s32 var; @@ -517,14 +517,14 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -551,10 +551,10 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0 && (npc->duration <= 0 || --npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if (aiSettings->unk_2C <= 0 || aiSettings->waitTime <= 0 || script->functionTemp[1].s < 3) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if (aiSettings->unk_2C <= 0 || aiSettings->waitTime <= 0 || script->functionTemp[1] < 3) { + script->functionTemp[0] = 0; } } } @@ -575,7 +575,7 @@ void N(func_80241AE4_BE5294)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -617,7 +617,7 @@ ApiStatus N(func_8024219C_BE594C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -684,18 +684,18 @@ void N(func_8024255C_BE5D0C)(ScriptInstance* script, NpcAISettings* aiSettings, Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { npc->currentAnim.w = enemy->animList[9]; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->duration = 12; - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } #include "world/common/UnkNpcAIFunc21.inc.c" @@ -729,7 +729,7 @@ void N(func_80242A1C_BE61CC)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration < 15) { npc->duration = 15; } - script->functionTemp[0].s = 0x16; + script->functionTemp[0] = 0x16; } } @@ -747,7 +747,7 @@ void N(func_80242D0C_BE64BC)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } @@ -780,7 +780,7 @@ ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { @@ -800,26 +800,26 @@ ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - if ((u32)script->functionTemp[0].s - 12 < 3 && N(func_80242388_BE5B38)(script, aiSettings, territoryPtr)) { - script->functionTemp[0].s = 20; + if ((u32)script->functionTemp[0] - 12 < 3 && N(func_80242388_BE5B38)(script, aiSettings, territoryPtr)) { + script->functionTemp[0] = 20; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc18)(script, aiSettings, territoryPtr); case 1: N(func_8024255C_BE5D0C)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 2) { + if (script->functionTemp[0] != 2) { return ApiStatus_BLOCK; } case 2: N(UnkNpcAIFunc21)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 3) { + if (script->functionTemp[0] != 3) { return ApiStatus_BLOCK; } case 3: N(UnkNpcAIFunc20)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 4) { + if (script->functionTemp[0] != 4) { return ApiStatus_BLOCK; } case 4: @@ -829,18 +829,18 @@ ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_BLOCK; case 12: func_80049F7C(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { return ApiStatus_BLOCK; } case 13: func_8004A124(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 14) { + if (script->functionTemp[0] != 14) { return ApiStatus_BLOCK; } case 14: npc->duration--; if (npc->duration == 0) { - script->functionTemp[0].s = 40; + script->functionTemp[0] = 40; } return ApiStatus_BLOCK; case 20: @@ -853,7 +853,7 @@ ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_BLOCK; case 40: N(func_80242D0C_BE64BC)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 41) { + if (script->functionTemp[0] != 41) { return ApiStatus_BLOCK; } case 41: @@ -863,7 +863,7 @@ ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc19)(script, aiSettings, territoryPtr); case 51: N(UnkNpcAIFunc17)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 52) { + if (script->functionTemp[0] != 52) { return ApiStatus_BLOCK; } case 52: diff --git a/src/world/area_arn/arn_05/events.c b/src/world/area_arn/arn_05/events.c index 011a9d829e..b78c343711 100644 --- a/src/world/area_arn/arn_05/events.c +++ b/src/world/area_arn/arn_05/events.c @@ -1042,7 +1042,7 @@ ApiStatus N(func_80240B94_BE8774)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -1053,11 +1053,11 @@ ApiStatus N(func_80240B94_BE8774)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -1071,7 +1071,7 @@ ApiStatus N(func_80240B94_BE8774)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, aiSettings, territoryPtr); case 1: @@ -1117,18 +1117,18 @@ void N(func_80240E90_BE8A70)(ScriptInstance* script, NpcAISettings* aiSettings, posX = npc->pos.x; posZ = npc->pos.z; - temp_f22 = script->functionTemp[2].s[enemy->territory->patrol.points].x; - temp_f20 = script->functionTemp[2].s[enemy->territory->patrol.points].z; + temp_f22 = script->functionTemp[2][enemy->territory->patrol.points].x; + temp_f20 = script->functionTemp[2][enemy->territory->patrol.points].z; npc->yaw = atan2(posX, posZ, temp_f22, temp_f20); npc_move_heading(npc, npc->moveSpeed, npc->yaw); posX = npc->pos.x; - posY = npc->pos.y + script->functionTemp[2].s[enemy->territory->patrol.points].y; + posY = npc->pos.y + script->functionTemp[2][enemy->territory->patrol.points].y; posZ = npc->pos.z; posW = 1000.0f; npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW); - posY += script->functionTemp[2].s[enemy->territory->patrol.points].y; + posY += script->functionTemp[2][enemy->territory->patrol.points].y; posW = posY - npc->pos.y; if (posW > 2.0) { npc->pos.y += 2.0; @@ -1140,7 +1140,7 @@ void N(func_80240E90_BE8A70)(ScriptInstance* script, NpcAISettings* aiSettings, posW = dist2D(npc->pos.x, npc->pos.z, temp_f22, temp_f20); if (!(posW > npc->moveSpeed)) { - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } } @@ -1150,12 +1150,12 @@ void N(func_80241068_BE8C48)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration < 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s >= 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] >= 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); } else { - script->functionTemp[0].s = 4; + script->functionTemp[0] = 4; npc->currentAnim.w = enemy->animList[0]; } } @@ -1179,12 +1179,12 @@ ApiStatus N(func_8024113C_BE8D1C)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->flags &= ~0x800; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, aiSettings, territoryPtr); case 1: diff --git a/src/world/area_arn/arn_07/events.c b/src/world/area_arn/arn_07/events.c index 76fd581301..b5b64a4c22 100644 --- a/src/world/area_arn/arn_07/events.c +++ b/src/world/area_arn/arn_07/events.c @@ -1253,22 +1253,22 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -1296,10 +1296,10 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -1321,7 +1321,7 @@ void N(func_802415A4_BEE394)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80243BC0_BF09B0)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -1363,7 +1363,7 @@ ApiStatus N(func_80241C5C_BEEA4C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: diff --git a/src/world/area_arn/arn_08/BF47A0.c b/src/world/area_arn/arn_08/BF47A0.c index 4d005f97c4..aed5217cc4 100644 --- a/src/world/area_arn/arn_08/BF47A0.c +++ b/src/world/area_arn/arn_08/BF47A0.c @@ -6,15 +6,15 @@ ApiStatus N(func_80240000_BF47A0)(ScriptInstance* script, s32 isInitialCall) { s32 colliderID; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; suggest_player_anim_clearUnkFlag(0x10007); } temp_f20 = func_800E34D8(); playerStatus->position.y = player_check_collision_below(temp_f20, &colliderID); - script->functionTemp[0].s += fabsf(temp_f20); + script->functionTemp[0] += fabsf(temp_f20); do {} while (0); - return (script->functionTemp[0].s > 50) * ApiStatus_DONE2; + return (script->functionTemp[0] > 50) * ApiStatus_DONE2; } ApiStatus N(func_8024008C_BF482C)(ScriptInstance* script, s32 isInitialCall) { diff --git a/src/world/area_arn/arn_08/events.c b/src/world/area_arn/arn_08/events.c index 78c1e22db2..009db969dd 100644 --- a/src/world/area_arn/arn_08/events.c +++ b/src/world/area_arn/arn_08/events.c @@ -431,7 +431,7 @@ ApiStatus N(func_802400F4_BF4894)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } if (!(playerStatus->position.y > -10.0f)) { @@ -439,9 +439,9 @@ ApiStatus N(func_802400F4_BF4894)(ScriptInstance* script, s32 isInitialCall) { s32 colliderID; playerStatus->position.y = player_check_collision_below(temp_f20, &colliderID); - script->functionTemp[0].s += fabsf(temp_f20); + script->functionTemp[0] += fabsf(temp_f20); - return (script->functionTemp[0].s > 50) * ApiStatus_DONE2; + return (script->functionTemp[0] > 50) * ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/world/area_dgb/dgb_01/BFD9A0.c b/src/world/area_dgb/dgb_01/BFD9A0.c index 3b6807563a..725c389594 100644 --- a/src/world/area_dgb/dgb_01/BFD9A0.c +++ b/src/world/area_dgb/dgb_01/BFD9A0.c @@ -576,22 +576,22 @@ void N(func_802402D0_BFDB50)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -619,10 +619,10 @@ void N(func_802402D0_BFDB50)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -644,7 +644,7 @@ void N(func_80240D74_BFE5F4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80244CD0_C02550)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -686,7 +686,7 @@ ApiStatus N(func_8024142C_BFECAC)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -739,7 +739,7 @@ void N(func_80241618_BFEE98)(ScriptInstance* script, NpcAISettings* aiSettings, } } npc->yaw = clamp_angle(phi_f20); - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; } } @@ -752,16 +752,16 @@ void N(func_80241770_BFEFF0)(ScriptInstance* script, NpcAISettings* aiSettings, if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { npc->duration = 0; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } else { npc->duration--; if (npc->duration <= 0) { npc->flags |= 0x200000; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } } else { - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } @@ -786,7 +786,7 @@ void N(func_80241874_BFF0F4)(ScriptInstance* script, NpcAISettings* aiSettings, sfx_play_sound_at_position(0x80000011, 2, npc->pos.x, npc->pos.y, npc->pos.z); npc->duration = 0; - script->functionTemp[0].s = 15; + script->functionTemp[0] = 15; } void N(func_80241954_BFF1D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -800,7 +800,7 @@ void N(func_80241954_BFF1D4)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[0] &= ~0x100; npc->rotation.y = 0.0f; npc->flags &= ~0x00200000; - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } else { npc->pos.x = gPlayerStatusPtr->position.x; npc->pos.z = gPlayerStatusPtr->position.z + 2.0f; @@ -825,9 +825,9 @@ void N(func_80241954_BFF1D4)(ScriptInstance* script, NpcAISettings* aiSettings, disable_player_input(); partner_disable_input(); npc->duration = 0; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } else { - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } } @@ -845,7 +845,7 @@ void N(func_80241BF0_BFF470)(ScriptInstance* script, NpcAISettings* aiSettings, } npc->currentAnim.w = enemy->animList[9]; npc->duration = 20; - script->functionTemp[0].s = 17; + script->functionTemp[0] = 17; } void N(func_80241CA8_BFF528)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -867,7 +867,7 @@ void N(func_80241CA8_BFF528)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y = posY + temp_f20; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var); npc->duration = 10; - script->functionTemp[0].s = 18; + script->functionTemp[0] = 18; } } @@ -877,7 +877,7 @@ void N(func_80241E28_BFF6A8)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration <= 0) { - script->functionTemp[0].s = 30; + script->functionTemp[0] = 30; } } @@ -889,11 +889,11 @@ void N(func_80241E70_BFF6F0)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration >= 3) { if (D_8010EBB0.unk_03 != 9) { npc->duration = 0; - script->functionTemp[0].s = 100; + script->functionTemp[0] = 100; } else { enable_player_input(); partner_enable_input(); - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } } @@ -907,7 +907,7 @@ void N(func_80241EF0_BFF770)(ScriptInstance* script, NpcAISettings* aiSettings, npc->moveSpeed = 2.0 * aiSettings->moveSpeed; enemy->varTable[2] = 0; enemy->varTable[4] = npc->pos.y * 100.0; - script->functionTemp[1].s = 0x1E; + script->functionTemp[1] = 0x1E; } void N(func_80241F98_BFF818)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -931,25 +931,25 @@ void N(func_80241F98_BFF818)(ScriptInstance* script, NpcAISettings* aiSettings, } enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 12); - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->moveToPos.y = npc->pos.y; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; if (npc->turnAroundYawAdjustment == 0) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); posW = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); if (posW <= (2.0f * npc->moveSpeed)) { - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - script->functionTemp[0].s = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + script->functionTemp[0] = 2; } } } @@ -972,17 +972,17 @@ ApiStatus N(func_802422B0_BFFB30)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; N(UnkFunc5)(npc, enemy, script, aiSettings); } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0); case 1: N(func_802402D0_BFDB50)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->duration = 6; } break; @@ -990,13 +990,13 @@ ApiStatus N(func_802422B0_BFFB30)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); case 3: N(UnkFunc4)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->duration = 6; } break; case 12: N(func_80241618_BFEE98)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -1004,7 +1004,7 @@ ApiStatus N(func_802422B0_BFFB30)(ScriptInstance* script, s32 isInitialCall) { break; case 14: N(func_80241874_BFF0F4)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 15) { + if (script->functionTemp[0] != 15) { break; } case 15: @@ -1027,7 +1027,7 @@ ApiStatus N(func_802422B0_BFFB30)(ScriptInstance* script, s32 isInitialCall) { N(func_80241F98_BFF818)(script, aiSettings, territoryPtr); } - return (script->functionTemp[0].s == 100) * ApiStatus_DONE2; + return (script->functionTemp[0] == 100) * ApiStatus_DONE2; } const char N(dgb_00_name_hack)[]; @@ -1272,7 +1272,7 @@ ApiStatus N(func_802430C0_C00940)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -1283,11 +1283,11 @@ ApiStatus N(func_802430C0_C00940)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -1301,7 +1301,7 @@ ApiStatus N(func_802430C0_C00940)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, aiSettings, territoryPtr); case 1: diff --git a/src/world/area_dgb/dgb_02/C2EBA0.c b/src/world/area_dgb/dgb_02/C2EBA0.c index 9f0f42c054..60bd8e469f 100644 --- a/src/world/area_dgb/dgb_02/C2EBA0.c +++ b/src/world/area_dgb/dgb_02/C2EBA0.c @@ -478,7 +478,7 @@ ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -488,18 +488,18 @@ ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C2EDA8)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C2EDA8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -527,12 +527,12 @@ ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -558,7 +558,7 @@ void N(func_802408D0_C2F470)(ScriptInstance* script, NpcAISettings* aiSettings, } else if (npc->duration <= 0) { npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } } @@ -602,7 +602,7 @@ void N(func_80240958_C2F4F8)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } npc->duration++; @@ -626,7 +626,7 @@ void N(func_80240C10_C2F7B0)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration <= 0) { npc->duration = 1; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } } @@ -636,8 +636,8 @@ void N(func_80240C74_C2F814)(ScriptInstance* script, NpcAISettings* aiSettings, npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); npc->currentAnim.w = enemy->animList[0]; - script->functionTemp[1].s = (rand_int(1000) % 2) + 2; - script->functionTemp[0].s = 4; + script->functionTemp[1] = (rand_int(1000) % 2) + 2; + script->functionTemp[0] = 4; } void N(func_80240D1C_C2F8BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -647,14 +647,14 @@ void N(func_80240D1C_C2F8BC)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } npc->duration--; if (npc->duration <= 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); return; @@ -663,10 +663,10 @@ void N(func_80240D1C_C2F8BC)(ScriptInstance* script, NpcAISettings* aiSettings, var = enemy->varTable[7]; if (var == 40) { npc->duration = 20; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } else if (var == 50) { npc->duration = 25; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } } } @@ -683,7 +683,7 @@ void N(func_80240E54_C2F9F4)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } @@ -694,13 +694,13 @@ void N(func_80240F00_C2FAA0)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } else if (npc->turnAroundYawAdjustment == 0) { var = npc->yaw; func_8004A784(npc, 5.0f, &var, 0, 0, 0); @@ -718,7 +718,7 @@ void N(func_80241078_C2FC18)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration <= 0) { npc->duration = 0; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } } @@ -741,7 +741,7 @@ ApiStatus N(func_802410D4_C2FC74)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 30; npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; @@ -752,18 +752,18 @@ ApiStatus N(func_802410D4_C2FC74)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 40; + script->functionTemp[0] = 99; + script->functionTemp[1] = 40; npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } - if (((u32)script->functionTemp[0].s - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C2EDA8)(script)) { - script->functionTemp[0].s = 30; + if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C2EDA8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(func_802408D0_C2F470)(script, npcAISettings, territoryPtr); break; @@ -781,7 +781,7 @@ ApiStatus N(func_802410D4_C2FC74)(ScriptInstance* script, s32 isInitialCall) { break; case 12: func_80049F7C(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -791,16 +791,16 @@ ApiStatus N(func_802410D4_C2FC74)(ScriptInstance* script, s32 isInitialCall) { func_8004A3E8(script, npcAISettings, territoryPtr); npc->duration = 15; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; break; case 30: N(UnkNpcAIFunc6)(script); - if (script->functionTemp[0].s != 31) { + if (script->functionTemp[0] != 31) { break; } case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: @@ -811,7 +811,7 @@ ApiStatus N(func_802410D4_C2FC74)(ScriptInstance* script, s32 isInitialCall) { break; case 40: N(func_80240E54_C2F9F4)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 41) { + if (script->functionTemp[0] != 41) { break; } case 41: diff --git a/src/world/area_dgb/dgb_03/C31730.c b/src/world/area_dgb/dgb_03/C31730.c index 4b62c9c012..1bca8a62c1 100644 --- a/src/world/area_dgb/dgb_03/C31730.c +++ b/src/world/area_dgb/dgb_03/C31730.c @@ -803,7 +803,7 @@ ApiStatus N(func_8024086C_C31D4C)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -813,18 +813,18 @@ ApiStatus N(func_8024086C_C31D4C)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240458_C31938)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240458_C31938)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -852,12 +852,12 @@ ApiStatus N(func_8024086C_C31D4C)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -911,7 +911,7 @@ ApiStatus N(func_802416B4_C32B94)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -922,11 +922,11 @@ ApiStatus N(func_802416B4_C32B94)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -940,7 +940,7 @@ ApiStatus N(func_802416B4_C32B94)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr); case 1: @@ -995,7 +995,7 @@ ApiStatus N(func_802419B0_C32E90)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -1005,18 +1005,18 @@ ApiStatus N(func_802419B0_C32E90)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240458_C31938)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240458_C31938)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr); case 1: @@ -1047,12 +1047,12 @@ ApiStatus N(func_802419B0_C32E90)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -1078,7 +1078,7 @@ void N(func_80241C7C_C3315C)(ScriptInstance* script, NpcAISettings* aiSettings, } else if (npc->duration <= 0) { npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } } @@ -1122,7 +1122,7 @@ void N(func_80241D04_C331E4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } npc->duration++; @@ -1146,7 +1146,7 @@ void N(func_80241FBC_C3349C)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration <= 0) { npc->duration = 1; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } } @@ -1156,8 +1156,8 @@ void N(func_80242020_C33500)(ScriptInstance* script, NpcAISettings* aiSettings, npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); npc->currentAnim.w = enemy->animList[0]; - script->functionTemp[1].s = (rand_int(1000) % 2) + 2; - script->functionTemp[0].s = 4; + script->functionTemp[1] = (rand_int(1000) % 2) + 2; + script->functionTemp[0] = 4; } void N(func_802420C8_C335A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -1167,14 +1167,14 @@ void N(func_802420C8_C335A8)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } npc->duration--; if (npc->duration <= 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); return; @@ -1183,10 +1183,10 @@ void N(func_802420C8_C335A8)(ScriptInstance* script, NpcAISettings* aiSettings, var = enemy->varTable[7]; if (var == 40) { npc->duration = 20; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } else if (var == 50) { npc->duration = 25; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } } } @@ -1203,7 +1203,7 @@ void N(func_80242200_C336E0)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } @@ -1214,13 +1214,13 @@ void N(func_802422AC_C3378C)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } else if (npc->turnAroundYawAdjustment == 0) { var = npc->yaw; func_8004A784(npc, 5.0f, &var, 0, 0, 0); @@ -1238,7 +1238,7 @@ void N(func_80242424_C33904)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration <= 0) { npc->duration = 0; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } } @@ -1261,7 +1261,7 @@ ApiStatus N(func_80242480_C33960)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 30; npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; @@ -1272,18 +1272,18 @@ ApiStatus N(func_80242480_C33960)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 40; + script->functionTemp[0] = 99; + script->functionTemp[1] = 40; npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } - if (((u32)script->functionTemp[0].s - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240458_C31938)(script)) { - script->functionTemp[0].s = 30; + if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240458_C31938)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(func_80241C7C_C3315C)(script, npcAISettings, territoryPtr); break; @@ -1301,7 +1301,7 @@ ApiStatus N(func_80242480_C33960)(ScriptInstance* script, s32 isInitialCall) { break; case 12: func_80049F7C(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -1311,16 +1311,16 @@ ApiStatus N(func_80242480_C33960)(ScriptInstance* script, s32 isInitialCall) { func_8004A3E8(script, npcAISettings, territoryPtr); npc->duration = 15; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; break; case 30: N(UnkNpcAIFunc6)(script); - if (script->functionTemp[0].s != 31) { + if (script->functionTemp[0] != 31) { break; } case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: @@ -1331,7 +1331,7 @@ ApiStatus N(func_80242480_C33960)(ScriptInstance* script, s32 isInitialCall) { break; case 40: N(func_80242200_C336E0)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 41) { + if (script->functionTemp[0] != 41) { break; } case 41: diff --git a/src/world/area_dgb/dgb_04/C36530.c b/src/world/area_dgb/dgb_04/C36530.c index a717f550bd..17baef49fc 100644 --- a/src/world/area_dgb/dgb_04/C36530.c +++ b/src/world/area_dgb/dgb_04/C36530.c @@ -486,22 +486,22 @@ void N(func_802401B0_C366E0)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -529,10 +529,10 @@ void N(func_802401B0_C366E0)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -554,7 +554,7 @@ void N(func_80240C54_C37184)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80243560_C39A90)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -596,7 +596,7 @@ ApiStatus N(func_8024130C_C3783C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -648,7 +648,7 @@ void N(func_802414F8_C37A28)(ScriptInstance* script, NpcAISettings* aiSettings, } } npc->yaw = clamp_angle(phi_f20); - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; } } @@ -661,16 +661,16 @@ void N(func_80241650_C37B80)(ScriptInstance* script, NpcAISettings* aiSettings, if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { npc->duration = 0; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } else { npc->duration--; if (npc->duration <= 0) { npc->flags |= 0x200000; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } } else { - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } @@ -686,7 +686,7 @@ void N(func_80241754_C37C84)(ScriptInstance* script, NpcAISettings* aiSettings, } sfx_play_sound_at_position(0x80000011, 2, npc->pos.x, npc->pos.y, npc->pos.z); npc->duration = 0; - script->functionTemp[0].s = 15; + script->functionTemp[0] = 15; } void N(func_802417F8_C37D28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -700,7 +700,7 @@ void N(func_802417F8_C37D28)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[0] &= ~0x100; npc->rotation.y = 0.0f; npc->flags &= ~0x00200000; - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } else { npc->pos.x = gPlayerStatusPtr->position.x; npc->pos.z = gPlayerStatusPtr->position.z + 2.0f; @@ -725,9 +725,9 @@ void N(func_802417F8_C37D28)(ScriptInstance* script, NpcAISettings* aiSettings, disable_player_input(); partner_disable_input(); npc->duration = 0; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } else { - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } } @@ -745,7 +745,7 @@ void N(func_80241A94_C37FC4)(ScriptInstance* script, NpcAISettings* aiSettings, } npc->currentAnim.w = enemy->animList[9]; npc->duration = 20; - script->functionTemp[0].s = 17; + script->functionTemp[0] = 17; } void N(func_80241B4C_C3807C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -767,7 +767,7 @@ void N(func_80241B4C_C3807C)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y = posY + temp_f20; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var); npc->duration = 10; - script->functionTemp[0].s = 18; + script->functionTemp[0] = 18; } } @@ -777,7 +777,7 @@ void N(func_80241CCC_C381FC)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration <= 0) { - script->functionTemp[0].s = 30; + script->functionTemp[0] = 30; } } @@ -789,11 +789,11 @@ void N(func_80241D14_C38244)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration >= 3) { if (D_8010EBB0.unk_03 != 9) { npc->duration = 0; - script->functionTemp[0].s = 100; + script->functionTemp[0] = 100; } else { enable_player_input(); partner_enable_input(); - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } } @@ -807,7 +807,7 @@ void N(func_80241D94_C382C4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->moveSpeed = 2.0 * aiSettings->moveSpeed; enemy->varTable[2] = 0; enemy->varTable[4] = npc->pos.y * 100.0; - script->functionTemp[1].s = 0x1E; + script->functionTemp[1] = 0x1E; } void N(func_80241E3C_C3836C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -831,25 +831,25 @@ void N(func_80241E3C_C3836C)(ScriptInstance* script, NpcAISettings* aiSettings, } enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 12); - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->moveToPos.y = npc->pos.y; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; if (npc->turnAroundYawAdjustment == 0) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); posW = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); if (posW <= (2.0f * npc->moveSpeed)) { - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - script->functionTemp[0].s = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + script->functionTemp[0] = 2; } } } @@ -872,17 +872,17 @@ ApiStatus N(func_80242154_C38684)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; N(UnkFunc5)(npc, enemy, script, aiSettings); } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0); case 1: N(func_802401B0_C366E0)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->duration = 6; } break; @@ -890,13 +890,13 @@ ApiStatus N(func_80242154_C38684)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); case 3: N(UnkFunc4)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->duration = 6; } break; case 12: N(func_802414F8_C37A28)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -904,7 +904,7 @@ ApiStatus N(func_80242154_C38684)(ScriptInstance* script, s32 isInitialCall) { break; case 14: N(func_80241754_C37C84)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 15) { + if (script->functionTemp[0] != 15) { break; } case 15: @@ -927,7 +927,7 @@ ApiStatus N(func_80242154_C38684)(ScriptInstance* script, s32 isInitialCall) { N(func_80241E3C_C3836C)(script, aiSettings, territoryPtr); } - return (script->functionTemp[0].s == 100) * ApiStatus_DONE2; + return (script->functionTemp[0] == 100) * ApiStatus_DONE2; } #include "world/common/SetOverrideFlags_40.inc.c" @@ -973,8 +973,8 @@ ApiStatus N(func_8024259C_C38ACC)(ScriptInstance* script, s32 isInitialCall) { s32 idx; if (isInitialCall) { - script->functionTemp[2].s = heap_malloc(0x330); - ptr = script->functionTemp[2].s; + script->functionTemp[2] = heap_malloc(0x330); + ptr = script->functionTemp[2]; partnerActiveCount = 0; var = script->varTable[12] >= 0; @@ -1004,34 +1004,34 @@ ApiStatus N(func_8024259C_C38ACC)(ScriptInstance* script, s32 isInitialCall) { ptr->unk_324 = partnerActiveCount; ptr->unk_328 = 0; create_popup_menu(ptr); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - ptr = script->functionTemp[2].s; - if (script->functionTemp[0].s == 0) { - script->functionTemp[1].s = ptr->unk_32C; - if (script->functionTemp[1].s != 0) { + ptr = script->functionTemp[2]; + if (script->functionTemp[0] == 0) { + script->functionTemp[1] = ptr->unk_32C; + if (script->functionTemp[1] != 0) { hide_popup_menu(); } else { return ApiStatus_BLOCK; } } - script->functionTemp[0].s++; + script->functionTemp[0]++; - if (script->functionTemp[0].s < 15) { + if (script->functionTemp[0] < 15) { return ApiStatus_BLOCK; } destroy_popup_menu(); - if (script->functionTemp[1].s != 0xFF) { - script->varTable[0] = D_8008EF20[ptr->unk_108[script->functionTemp[1].s - 1]][0]; - script->varTable[1] = ptr->unk_108[script->functionTemp[1].s - 1]; + if (script->functionTemp[1] != 0xFF) { + script->varTable[0] = D_8008EF20[ptr->unk_108[script->functionTemp[1] - 1]][0]; + script->varTable[1] = ptr->unk_108[script->functionTemp[1] - 1]; } else { script->varTable[0] = -1; } - heap_free(script->functionTemp[2].s); + heap_free(script->functionTemp[2]); return ApiStatus_DONE2; } @@ -1202,42 +1202,42 @@ s32 N(func_80242F08_C39438)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { script->varTable[0] = get_variable(script, *args++); script->varTable[1] = get_variable(script, *args++); - script->functionTemp[0].s = 0; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 0; + script->functionTemp[1] = 0; set_screen_overlay_color(0, 0xD0, 0xD0, 0xD0); } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: - if (script->functionTemp[1].s == 0xFF) { - script->functionTemp[0].s = 1; - script->functionTemp[2].s = 0; + if (script->functionTemp[1] == 0xFF) { + script->functionTemp[0] = 1; + script->functionTemp[2] = 0; } - script->functionTemp[1].s += script->varTable[0]; - if (script->functionTemp[1].s >= 0x100) { - script->functionTemp[1].s = 0xFF; + script->functionTemp[1] += script->varTable[0]; + if (script->functionTemp[1] >= 0x100) { + script->functionTemp[1] = 0xFF; } break; case 1: - script->functionTemp[2].s++; - if (script->functionTemp[2].s >= 2) { - script->functionTemp[0].s = 2; + script->functionTemp[2]++; + if (script->functionTemp[2] >= 2) { + script->functionTemp[0] = 2; } break; case 2: - if (script->functionTemp[1].s == 0) { + if (script->functionTemp[1] == 0) { ret = 1; } - script->functionTemp[1].s -= script->varTable[1]; - if (script->functionTemp[1].s < 0) { - script->functionTemp[1].s = 0; + script->functionTemp[1] -= script->varTable[1]; + if (script->functionTemp[1] < 0) { + script->functionTemp[1] = 0; } break; } - set_screen_overlay_params_front(1, script->functionTemp[1].s); + set_screen_overlay_params_front(1, script->functionTemp[1]); return ret; } diff --git a/src/world/area_dgb/dgb_05/C3AA10.c b/src/world/area_dgb/dgb_05/C3AA10.c index 7a40a1597f..1d89d31ad3 100644 --- a/src/world/area_dgb/dgb_05/C3AA10.c +++ b/src/world/area_dgb/dgb_05/C3AA10.c @@ -408,7 +408,7 @@ void N(func_8024067C_C3B08C)(ScriptInstance* script, NpcAISettings* aiSettings, } else if (npc->duration <= 0) { npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } } @@ -452,7 +452,7 @@ void N(func_80240704_C3B114)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } npc->duration++; @@ -476,7 +476,7 @@ void N(func_802409BC_C3B3CC)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration <= 0) { npc->duration = 1; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } } @@ -486,8 +486,8 @@ void N(func_80240A20_C3B430)(ScriptInstance* script, NpcAISettings* aiSettings, npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); npc->currentAnim.w = enemy->animList[0]; - script->functionTemp[1].s = (rand_int(1000) % 2) + 2; - script->functionTemp[0].s = 4; + script->functionTemp[1] = (rand_int(1000) % 2) + 2; + script->functionTemp[0] = 4; } void N(func_80240AC8_C3B4D8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -497,14 +497,14 @@ void N(func_80240AC8_C3B4D8)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } npc->duration--; if (npc->duration <= 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); return; @@ -513,10 +513,10 @@ void N(func_80240AC8_C3B4D8)(ScriptInstance* script, NpcAISettings* aiSettings, var = enemy->varTable[7]; if (var == 40) { npc->duration = 20; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } else if (var == 50) { npc->duration = 25; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } } } @@ -533,7 +533,7 @@ void N(func_80240C00_C3B610)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } @@ -544,13 +544,13 @@ void N(func_80240CAC_C3B6BC)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } else if (npc->turnAroundYawAdjustment == 0) { var = npc->yaw; func_8004A784(npc, 5.0f, &var, 0, 0, 0); @@ -568,7 +568,7 @@ void N(func_80240E24_C3B834)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration <= 0) { npc->duration = 0; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } } @@ -591,7 +591,7 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 30; npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; @@ -602,18 +602,18 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 40; + script->functionTemp[0] = 99; + script->functionTemp[1] = 40; npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } - if (((u32)script->functionTemp[0].s - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240268_C3AC78)(script)) { - script->functionTemp[0].s = 30; + if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240268_C3AC78)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(func_8024067C_C3B08C)(script, npcAISettings, territoryPtr); break; @@ -631,7 +631,7 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance* script, s32 isInitialCall) { break; case 12: func_80049F7C(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -641,16 +641,16 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance* script, s32 isInitialCall) { func_8004A3E8(script, npcAISettings, territoryPtr); npc->duration = 0xF; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; break; case 30: N(UnkNpcAIFunc6)(script); - if (script->functionTemp[0].s != 31) { + if (script->functionTemp[0] != 31) { break; } case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: @@ -661,7 +661,7 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance* script, s32 isInitialCall) { break; case 40: N(func_80240C00_C3B610)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 41) { + if (script->functionTemp[0] != 41) { break; } case 41: @@ -695,7 +695,7 @@ ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -705,18 +705,18 @@ ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240268_C3AC78)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240268_C3AC78)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -744,12 +744,12 @@ ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_dgb/dgb_07/C3DBF0.c b/src/world/area_dgb/dgb_07/C3DBF0.c index 9495bce7f2..08fdcbd052 100644 --- a/src/world/area_dgb/dgb_07/C3DBF0.c +++ b/src/world/area_dgb/dgb_07/C3DBF0.c @@ -317,7 +317,7 @@ void N(func_8024061C_C3E20C)(ScriptInstance* script, NpcAISettings* aiSettings, } else if (npc->duration <= 0) { npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } } @@ -361,7 +361,7 @@ void N(func_802406A4_C3E294)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } npc->duration++; @@ -385,7 +385,7 @@ void N(func_8024095C_C3E54C)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration <= 0) { npc->duration = 1; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } } @@ -395,8 +395,8 @@ void N(func_802409C0_C3E5B0)(ScriptInstance* script, NpcAISettings* aiSettings, npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); npc->currentAnim.w = enemy->animList[0]; - script->functionTemp[1].s = (rand_int(1000) % 2) + 2; - script->functionTemp[0].s = 4; + script->functionTemp[1] = (rand_int(1000) % 2) + 2; + script->functionTemp[0] = 4; } void N(func_80240A68_C3E658)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -406,14 +406,14 @@ void N(func_80240A68_C3E658)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } npc->duration--; if (npc->duration <= 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); return; @@ -422,10 +422,10 @@ void N(func_80240A68_C3E658)(ScriptInstance* script, NpcAISettings* aiSettings, var = enemy->varTable[7]; if (var == 40) { npc->duration = 20; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } else if (var == 50) { npc->duration = 25; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } } } @@ -442,7 +442,7 @@ void N(func_80240BA0_C3E790)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } @@ -453,13 +453,13 @@ void N(func_80240C4C_C3E83C)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } else if (npc->turnAroundYawAdjustment == 0) { var = npc->yaw; func_8004A784(npc, 5.0f, &var, 0, 0, 0); @@ -477,7 +477,7 @@ void N(func_80240DC4_C3E9B4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration <= 0) { npc->duration = 0; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } } @@ -500,7 +500,7 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 30; npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; @@ -511,18 +511,18 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 40; + script->functionTemp[0] = 99; + script->functionTemp[1] = 40; npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } - if (((u32)script->functionTemp[0].s - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C3DDF8)(script)) { - script->functionTemp[0].s = 30; + if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C3DDF8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(func_8024061C_C3E20C)(script, npcAISettings, territoryPtr); break; @@ -540,7 +540,7 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance* script, s32 isInitialCall) { break; case 12: func_80049F7C(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -550,16 +550,16 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance* script, s32 isInitialCall) { func_8004A3E8(script, npcAISettings, territoryPtr); npc->duration = 15; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; break; case 30: N(UnkNpcAIFunc6)(script); - if (script->functionTemp[0].s != 31) { + if (script->functionTemp[0] != 31) { break; } case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: @@ -570,7 +570,7 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance* script, s32 isInitialCall) { break; case 40: N(func_80240BA0_C3E790)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 41) { + if (script->functionTemp[0] != 41) { break; } case 41: @@ -604,7 +604,7 @@ ApiStatus N(func_80241170_C3ED60)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -614,18 +614,18 @@ ApiStatus N(func_80241170_C3ED60)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C3DDF8)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C3DDF8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -653,12 +653,12 @@ ApiStatus N(func_80241170_C3ED60)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_dgb/dgb_08/C3FDB0.c b/src/world/area_dgb/dgb_08/C3FDB0.c index 1d1027df9b..64702a7f17 100644 --- a/src/world/area_dgb/dgb_08/C3FDB0.c +++ b/src/world/area_dgb/dgb_08/C3FDB0.c @@ -994,7 +994,7 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -1005,11 +1005,11 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -1023,7 +1023,7 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr); case 1: @@ -1126,7 +1126,7 @@ ApiStatus N(func_802414AC_C4125C)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -1136,18 +1136,18 @@ ApiStatus N(func_802414AC_C4125C)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241098_C40E48)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241098_C40E48)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -1175,12 +1175,12 @@ ApiStatus N(func_802414AC_C4125C)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -1284,22 +1284,22 @@ void N(func_80241910_C416C0)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -1327,10 +1327,10 @@ void N(func_80241910_C416C0)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -1352,7 +1352,7 @@ void N(func_802423B4_C42164)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80244460_C44210)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -1394,7 +1394,7 @@ ApiStatus N(func_80242A6C_C4281C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -1447,7 +1447,7 @@ void N(func_80242C58_C42A08)(ScriptInstance* script, NpcAISettings* aiSettings, } } npc->yaw = clamp_angle(phi_f20); - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; } } @@ -1460,16 +1460,16 @@ void N(func_80242DB0_C42B60)(ScriptInstance* script, NpcAISettings* aiSettings, if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { npc->duration = 0; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } else { npc->duration--; if (npc->duration <= 0) { npc->flags |= 0x200000; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } } else { - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } @@ -1493,7 +1493,7 @@ void N(func_80242EB4_C42C64)(ScriptInstance* script, NpcAISettings* aiSettings, } sfx_play_sound_at_position(0x80000011, 2, npc->pos.x, npc->pos.y, npc->pos.z); npc->duration = 0; - script->functionTemp[0].s = 15; + script->functionTemp[0] = 15; } void N(func_80242F94_C42D44)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -1507,7 +1507,7 @@ void N(func_80242F94_C42D44)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[0] &= ~0x100; npc->rotation.y = 0.0f; npc->flags &= ~0x00200000; - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } else { PlayerStatus** playerStatus = &gPlayerStatusPtr; @@ -1534,9 +1534,9 @@ void N(func_80242F94_C42D44)(ScriptInstance* script, NpcAISettings* aiSettings, disable_player_input(); partner_disable_input(); npc->duration = 0; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } else { - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } } @@ -1554,7 +1554,7 @@ void N(func_80243230_C42FE0)(ScriptInstance* script, NpcAISettings* aiSettings, } npc->currentAnim.w = enemy->animList[9]; npc->duration = 20; - script->functionTemp[0].s = 17; + script->functionTemp[0] = 17; } void N(func_802432E8_C43098)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -1576,7 +1576,7 @@ void N(func_802432E8_C43098)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y = posY + temp_f20; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var); npc->duration = 10; - script->functionTemp[0].s = 18; + script->functionTemp[0] = 18; } } @@ -1586,7 +1586,7 @@ void N(filemenu_update_show_options_right_C43218)(ScriptInstance* script, NpcAIS npc->duration--; if (npc->duration <= 0) { - script->functionTemp[0].s = 30; + script->functionTemp[0] = 30; } } @@ -1598,11 +1598,11 @@ void N(func_802434B0_C43260)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration >= 3) { if (D_8010EBB0.unk_03 != 9) { npc->duration = 0; - script->functionTemp[0].s = 100; + script->functionTemp[0] = 100; } else { enable_player_input(); partner_enable_input(); - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } } @@ -1616,7 +1616,7 @@ void N(func_80243530_C432E0)(ScriptInstance* script, NpcAISettings* aiSettings, npc->moveSpeed = 2.0 * aiSettings->moveSpeed; enemy->varTable[2] = 0; enemy->varTable[4] = npc->pos.y * 100.0; - script->functionTemp[1].s = 0x1E; + script->functionTemp[1] = 0x1E; } void N(func_802435D8_C43388)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -1640,25 +1640,25 @@ void N(func_802435D8_C43388)(ScriptInstance* script, NpcAISettings* aiSettings, } enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 12); - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->moveToPos.y = npc->pos.y; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; if (npc->turnAroundYawAdjustment == 0) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); posW = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); if (posW <= (2.0f * npc->moveSpeed)) { - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - script->functionTemp[0].s = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + script->functionTemp[0] = 2; } } } @@ -1681,17 +1681,17 @@ ApiStatus N(func_802438F0_C436A0)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; N(UnkFunc5)(npc, enemy, script, npcAISettings); } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, npcAISettings, territoryPtr); func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0); case 1: N(func_80241910_C416C0)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->duration = 6; } break; @@ -1699,13 +1699,13 @@ ApiStatus N(func_802438F0_C436A0)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc1_copy)(script, npcAISettings, territoryPtr); case 3: N(UnkFunc4)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->duration = 6; } break; case 12: N(func_80242C58_C42A08)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -1713,7 +1713,7 @@ ApiStatus N(func_802438F0_C436A0)(ScriptInstance* script, s32 isInitialCall) { break; case 14: N(func_80242EB4_C42C64)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 15) { + if (script->functionTemp[0] != 15) { break; } case 15: @@ -1736,7 +1736,7 @@ ApiStatus N(func_802438F0_C436A0)(ScriptInstance* script, s32 isInitialCall) { N(func_802435D8_C43388)(script, npcAISettings, territoryPtr); } - return (script->functionTemp[0].s == 100) * ApiStatus_DONE2; + return (script->functionTemp[0] == 100) * ApiStatus_DONE2; } #include "world/common/UnkFunc1.inc.c" diff --git a/src/world/area_dgb/dgb_09/C46BE0.c b/src/world/area_dgb/dgb_09/C46BE0.c index 7463c1f8d8..8701960a50 100644 --- a/src/world/area_dgb/dgb_09/C46BE0.c +++ b/src/world/area_dgb/dgb_09/C46BE0.c @@ -661,7 +661,7 @@ ApiStatus N(func_8024061C_C471FC)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -671,18 +671,18 @@ ApiStatus N(func_8024061C_C471FC)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C46DE8)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C46DE8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -710,12 +710,12 @@ ApiStatus N(func_8024061C_C471FC)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -741,7 +741,7 @@ void N(func_802408D0_C474B0)(ScriptInstance* script, NpcAISettings* aiSettings, } else if (npc->duration <= 0) { npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } } @@ -785,7 +785,7 @@ void N(func_80240958_C47538)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } npc->duration++; @@ -809,7 +809,7 @@ void N(func_80240C10_C477F0)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration <= 0) { npc->duration = 1; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } } @@ -819,8 +819,8 @@ void N(func_80240C74_C47854)(ScriptInstance* script, NpcAISettings* aiSettings, npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); npc->currentAnim.w = enemy->animList[0]; - script->functionTemp[1].s = (rand_int(1000) % 2) + 2; - script->functionTemp[0].s = 4; + script->functionTemp[1] = (rand_int(1000) % 2) + 2; + script->functionTemp[0] = 4; } void N(func_80240D1C_C478FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -830,14 +830,14 @@ void N(func_80240D1C_C478FC)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } npc->duration--; if (npc->duration <= 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); return; @@ -846,10 +846,10 @@ void N(func_80240D1C_C478FC)(ScriptInstance* script, NpcAISettings* aiSettings, var = enemy->varTable[7]; if (var == 40) { npc->duration = 20; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } else if (var == 50) { npc->duration = 25; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } } } @@ -866,7 +866,7 @@ void N(func_80240E54_C47A34)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } @@ -877,13 +877,13 @@ void N(func_80240F00_C47AE0)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } else if (npc->turnAroundYawAdjustment == 0) { var = npc->yaw; func_8004A784(npc, 5.0f, &var, 0, 0, 0); @@ -901,7 +901,7 @@ void N(func_80241078_C47C58)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration <= 0) { npc->duration = 0; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } } @@ -924,7 +924,7 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 30; npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; @@ -935,18 +935,18 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 40; + script->functionTemp[0] = 99; + script->functionTemp[1] = 40; npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } - if (((u32)script->functionTemp[0].s - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C46DE8)(script)) { - script->functionTemp[0].s = 30; + if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C46DE8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(func_802408D0_C474B0)(script, npcAISettings, territoryPtr); break; @@ -964,7 +964,7 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance* script, s32 isInitialCall) { break; case 12: func_80049F7C(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -974,16 +974,16 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance* script, s32 isInitialCall) { func_8004A3E8(script, npcAISettings, territoryPtr); npc->duration = 15; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; break; case 30: N(UnkNpcAIFunc6)(script); - if (script->functionTemp[0].s != 31) { + if (script->functionTemp[0] != 31) { break; } case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: @@ -994,7 +994,7 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance* script, s32 isInitialCall) { break; case 40: N(func_80240E54_C47A34)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 41) { + if (script->functionTemp[0] != 41) { break; } case 41: @@ -1101,22 +1101,22 @@ void N(func_802415D4_C481B4)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -1144,10 +1144,10 @@ void N(func_802415D4_C481B4)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -1169,7 +1169,7 @@ void N(func_80242078_C48C58)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80244358_C4AF38)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -1211,7 +1211,7 @@ ApiStatus N(func_80242730_C49310)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -1264,7 +1264,7 @@ void N(func_8024291C_C494FC)(ScriptInstance* script, NpcAISettings* aiSettings, } } npc->yaw = clamp_angle(phi_f20); - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; } } @@ -1277,16 +1277,16 @@ void N(func_80242A74_C49654)(ScriptInstance* script, NpcAISettings* aiSettings, if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { npc->duration = 0; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } else { npc->duration--; if (npc->duration <= 0) { npc->flags |= 0x200000; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } } else { - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } @@ -1302,7 +1302,7 @@ void N(func_80242B78_C49758)(ScriptInstance* script, NpcAISettings* aiSettings, } sfx_play_sound_at_position(0x80000011, 2, npc->pos.x, npc->pos.y, npc->pos.z); npc->duration = 0; - script->functionTemp[0].s = 15; + script->functionTemp[0] = 15; } void N(func_80242C1C_C497FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -1316,7 +1316,7 @@ void N(func_80242C1C_C497FC)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[0] &= ~0x100; npc->rotation.y = 0.0f; npc->flags &= ~0x00200000; - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } else { PlayerStatus** playerStatus = &gPlayerStatusPtr; @@ -1343,9 +1343,9 @@ void N(func_80242C1C_C497FC)(ScriptInstance* script, NpcAISettings* aiSettings, disable_player_input(); partner_disable_input(); npc->duration = 0; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; } else { - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } } @@ -1363,7 +1363,7 @@ void N(func_80242EB8_C49A98)(ScriptInstance* script, NpcAISettings* aiSettings, } npc->currentAnim.w = enemy->animList[9]; npc->duration = 20; - script->functionTemp[0].s = 17; + script->functionTemp[0] = 17; } void N(func_80242F70_C49B50)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -1385,7 +1385,7 @@ void N(func_80242F70_C49B50)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y = posY + temp_f20; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &var); npc->duration = 10; - script->functionTemp[0].s = 18; + script->functionTemp[0] = 18; } } @@ -1395,7 +1395,7 @@ void N(func_802430F0_C49CD0)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration <= 0) { - script->functionTemp[0].s = 30; + script->functionTemp[0] = 30; } } @@ -1407,11 +1407,11 @@ void N(func_80243138_C49D18)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration >= 3) { if (D_8010EBB0.unk_03 != 9) { npc->duration = 0; - script->functionTemp[0].s = 100; + script->functionTemp[0] = 100; } else { enable_player_input(); partner_enable_input(); - script->functionTemp[0].s = 16; + script->functionTemp[0] = 16; } } } @@ -1425,7 +1425,7 @@ void N(func_802431B8_C49D98)(ScriptInstance* script, NpcAISettings* aiSettings, npc->moveSpeed = 2.0 * aiSettings->moveSpeed; enemy->varTable[2] = 0; enemy->varTable[4] = npc->pos.y * 100.0; - script->functionTemp[1].s = 0x1E; + script->functionTemp[1] = 0x1E; } void N(func_80243260_C49E40)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -1449,25 +1449,25 @@ void N(func_80243260_C49E40)(ScriptInstance* script, NpcAISettings* aiSettings, } enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 12); - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.5, aiSettings->unk_10.f * 0.5, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->moveToPos.y = npc->pos.y; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; if (npc->turnAroundYawAdjustment == 0) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); posW = dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); if (posW <= (2.0f * npc->moveSpeed)) { - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - script->functionTemp[0].s = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + script->functionTemp[0] = 2; } } } @@ -1490,17 +1490,17 @@ ApiStatus N(func_80243578_C4A158)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; N(UnkFunc5)(npc, enemy, script, aiSettings); } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0); case 1: N(func_802415D4_C481B4)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->duration = 6; } break; @@ -1508,13 +1508,13 @@ ApiStatus N(func_80243578_C4A158)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); case 3: N(UnkFunc4)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->duration = 6; } break; case 12: N(func_8024291C_C494FC)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -1522,7 +1522,7 @@ ApiStatus N(func_80243578_C4A158)(ScriptInstance* script, s32 isInitialCall) { break; case 14: N(func_80242B78_C49758)(script, aiSettings, territoryPtr); - if (script->functionTemp[0].s != 15) { + if (script->functionTemp[0] != 15) { break; } case 15: @@ -1545,7 +1545,7 @@ ApiStatus N(func_80243578_C4A158)(ScriptInstance* script, s32 isInitialCall) { N(func_80243260_C49E40)(script, aiSettings, territoryPtr); } - return (script->functionTemp[0].s == 100) * ApiStatus_DONE2; + return (script->functionTemp[0] == 100) * ApiStatus_DONE2; } const char N(dgb_00_name_hack)[] = "dgb_00"; diff --git a/src/world/area_dgb/dgb_15/C4F510.c b/src/world/area_dgb/dgb_15/C4F510.c index b19cfb645b..9b5921defc 100644 --- a/src/world/area_dgb/dgb_15/C4F510.c +++ b/src/world/area_dgb/dgb_15/C4F510.c @@ -509,7 +509,7 @@ ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -519,18 +519,18 @@ ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C4F718)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C4F718)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -558,12 +558,12 @@ ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -617,7 +617,7 @@ ApiStatus N(func_80241464_C50974)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -628,11 +628,11 @@ ApiStatus N(func_80241464_C50974)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -646,7 +646,7 @@ ApiStatus N(func_80241464_C50974)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr); case 1: diff --git a/src/world/area_dgb/dgb_16/C52540.c b/src/world/area_dgb/dgb_16/C52540.c index 3a2774f352..62088144a2 100644 --- a/src/world/area_dgb/dgb_16/C52540.c +++ b/src/world/area_dgb/dgb_16/C52540.c @@ -674,7 +674,7 @@ void N(func_8024061C_C52B5C)(ScriptInstance* script, NpcAISettings* aiSettings, } else if (npc->duration <= 0) { npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } } @@ -718,7 +718,7 @@ void N(func_802406A4_C52BE4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } npc->duration++; @@ -742,7 +742,7 @@ void N(func_8024095C_C52E9C)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration <= 0) { npc->duration = 1; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } } @@ -752,8 +752,8 @@ void N(func_802409C0_C52F00)(ScriptInstance* script, NpcAISettings* aiSettings, npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); npc->currentAnim.w = enemy->animList[0]; - script->functionTemp[1].s = (rand_int(1000) % 2) + 2; - script->functionTemp[0].s = 4; + script->functionTemp[1] = (rand_int(1000) % 2) + 2; + script->functionTemp[0] = 4; } void N(func_80240A68_C52FA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { @@ -763,14 +763,14 @@ void N(func_80240A68_C52FA8)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } npc->duration--; if (npc->duration <= 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); return; @@ -779,10 +779,10 @@ void N(func_80240A68_C52FA8)(ScriptInstance* script, NpcAISettings* aiSettings, var = enemy->varTable[7]; if (var == 40) { npc->duration = 20; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } else if (var == 50) { npc->duration = 25; - script->functionTemp[0].s = var; + script->functionTemp[0] = var; } } } @@ -799,7 +799,7 @@ void N(func_80240BA0_C530E0)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } @@ -810,13 +810,13 @@ void N(func_80240C4C_C5318C)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } else if (npc->turnAroundYawAdjustment == 0) { var = npc->yaw; func_8004A784(npc, 5.0f, &var, 0, 0, 0); @@ -834,7 +834,7 @@ void N(func_80240DC4_C53304)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; if (npc->duration <= 0) { npc->duration = 0; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } } @@ -857,7 +857,7 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 30; npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; @@ -868,18 +868,18 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 40; + script->functionTemp[0] = 99; + script->functionTemp[1] = 40; npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } - if (((u32)script->functionTemp[0].s - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C52748)(script)) { - script->functionTemp[0].s = 30; + if (((u32)script->functionTemp[0] - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C52748)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(func_8024061C_C52B5C)(script, npcAISettings, territoryPtr); break; @@ -897,7 +897,7 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance* script, s32 isInitialCall) { break; case 12: func_80049F7C(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 13) { + if (script->functionTemp[0] != 13) { break; } case 13: @@ -907,16 +907,16 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance* script, s32 isInitialCall) { func_8004A3E8(script, npcAISettings, territoryPtr); npc->duration = 15; enemy->varTable[7] = 40; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; break; case 30: N(UnkNpcAIFunc6)(script); - if (script->functionTemp[0].s != 31) { + if (script->functionTemp[0] != 31) { break; } case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: @@ -927,7 +927,7 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance* script, s32 isInitialCall) { break; case 40: N(func_80240BA0_C530E0)(script, npcAISettings, territoryPtr); - if (script->functionTemp[0].s != 41) { + if (script->functionTemp[0] != 41) { break; } case 41: @@ -961,7 +961,7 @@ ApiStatus N(func_80241170_C536B0)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -971,18 +971,18 @@ ApiStatus N(func_80241170_C536B0)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C52748)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C52748)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -1010,12 +1010,12 @@ ApiStatus N(func_80241170_C536B0)(ScriptInstance* script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_dgb/dgb_18/C55F40.c b/src/world/area_dgb/dgb_18/C55F40.c index 4a090b284f..79e56dd62c 100644 --- a/src/world/area_dgb/dgb_18/C55F40.c +++ b/src/world/area_dgb/dgb_18/C55F40.c @@ -724,7 +724,7 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -735,11 +735,11 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -753,7 +753,7 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr); case 1: @@ -801,11 +801,11 @@ ApiStatus N(func_80240EBC_C56DFC)(ScriptInstance* script, s32 isInitialCall) { posZ = npc->pos.z; npc->moveSpeed = 3.7f; npc->yaw = atan2(posX, posZ, playerStatus->position.x, playerStatus->position.z); - script->functionTemp[1].s = 0; + script->functionTemp[1] = 0; npc->duration = 15; } - if (script->functionTemp[1].s == 0) { + if (script->functionTemp[1] == 0) { if (npc->duration == 0) { npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); npc->duration = 15; diff --git a/src/world/area_dro/dro_01/95B7E0.c b/src/world/area_dro/dro_01/95B7E0.c index 244305d6af..2fa65f0e68 100644 --- a/src/world/area_dro/dro_01/95B7E0.c +++ b/src/world/area_dro/dro_01/95B7E0.c @@ -2910,7 +2910,7 @@ ApiStatus N(func_80241174_95C374)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -2921,11 +2921,11 @@ ApiStatus N(func_80241174_95C374)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -2939,7 +2939,7 @@ ApiStatus N(func_80241174_95C374)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr); case 1: @@ -3262,8 +3262,8 @@ ApiStatus N(func_80242858_95DA58)(ScriptInstance* script, s32 isInitialCall) { s32 res; if (isInitialCall) { - script->functionTemp[1].s = (Unk_Struct_1*)heap_malloc(0x3C); - ptr = script->functionTemp[1].s; + script->functionTemp[1] = (Unk_Struct_1*)heap_malloc(0x3C); + ptr = script->functionTemp[1]; ptr->unk_00 = temp_s1->unk_00; ptr->unk_04 = temp_s1->unk_04; ptr->unk_08 = temp_s1->unk_08; @@ -3281,7 +3281,7 @@ ApiStatus N(func_80242858_95DA58)(ScriptInstance* script, s32 isInitialCall) { ptr->unk_38 = 0; } - ptr = script->functionTemp[1].s; + ptr = script->functionTemp[1]; switch (ptr->unk_20) { case 0: res = get_xz_dist_to_player(ptr->unk_00, ptr->unk_08); diff --git a/src/world/area_dro/dro_02/9694C0.c b/src/world/area_dro/dro_02/9694C0.c index f1bc6b0df6..5b064c0fc1 100644 --- a/src/world/area_dro/dro_02/9694C0.c +++ b/src/world/area_dro/dro_02/9694C0.c @@ -3370,16 +3370,16 @@ ApiStatus N(func_802414C0_96A680)(ScriptInstance* script, s32 isInitialCall) { npc->flags |= 0x800000; } } - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - script->functionTemp[0].s += 8; - if (script->functionTemp[0].s >= 0x100) { - script->functionTemp[0].s = 255; + script->functionTemp[0] += 8; + if (script->functionTemp[0] >= 0x100) { + script->functionTemp[0] = 255; } - set_background_color_blend(0, 0, 0, script->functionTemp[0].s); + set_background_color_blend(0, 0, 0, script->functionTemp[0]); - return (script->functionTemp[0].s == 255) * ApiStatus_DONE2; + return (script->functionTemp[0] == 255) * ApiStatus_DONE2; } ApiStatus N(func_802415CC_96A78C)(ScriptInstance* script, s32 isInitialCall) { @@ -3387,18 +3387,18 @@ ApiStatus N(func_802415CC_96A78C)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { set_background_color_blend(0, 0, 0, 0xFF); - script->functionTemp[0].s = 255; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 255; + script->functionTemp[1] = 0; } - script->functionTemp[0].s -= 8; - if (script->functionTemp[0].s < 0) { - script->functionTemp[0].s = 0; + script->functionTemp[0] -= 8; + if (script->functionTemp[0] < 0) { + script->functionTemp[0] = 0; } - set_background_color_blend(0, 0, 0, script->functionTemp[0].s); + set_background_color_blend(0, 0, 0, script->functionTemp[0]); - if (script->functionTemp[0].s == 0 && script->functionTemp[1].s == 0) { - script->functionTemp[1].s = 1; - } else if (script->functionTemp[1].s == 1) { + if (script->functionTemp[0] == 0 && script->functionTemp[1] == 0) { + script->functionTemp[1] = 1; + } else if (script->functionTemp[1] == 1) { mdl_set_all_fog_mode(0); *D_801512F0 = 0; for (i = 0; i < 64; i++) { diff --git a/src/world/area_flo/flo_00/C9DF60.c b/src/world/area_flo/flo_00/C9DF60.c index 422c3df99a..fa3999ca7b 100644 --- a/src/world/area_flo/flo_00/C9DF60.c +++ b/src/world/area_flo/flo_00/C9DF60.c @@ -2126,7 +2126,7 @@ ApiStatus N(func_80240BD4_C9EAF4)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -2137,11 +2137,11 @@ ApiStatus N(func_80240BD4_C9EAF4)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -2155,7 +2155,7 @@ ApiStatus N(func_80240BD4_C9EAF4)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr); case 1: diff --git a/src/world/area_flo/flo_08/CAED40.c b/src/world/area_flo/flo_08/CAED40.c index fc6fa9e588..ef4900175a 100644 --- a/src/world/area_flo/flo_08/CAED40.c +++ b/src/world/area_flo/flo_08/CAED40.c @@ -45,8 +45,8 @@ ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance* script, s32 isInitialCall) { s32 idx; if (isInitialCall) { - script->functionTemp[2].s = heap_malloc(0x330); - ptr = script->functionTemp[2].s; + script->functionTemp[2] = heap_malloc(0x330); + ptr = script->functionTemp[2]; partnerActiveCount = 0; var = script->varTable[12] >= 0; @@ -76,34 +76,34 @@ ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance* script, s32 isInitialCall) { ptr->unk_324 = partnerActiveCount; ptr->unk_328 = 0; create_popup_menu(ptr); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - ptr = script->functionTemp[2].s; - if (script->functionTemp[0].s == 0) { - script->functionTemp[1].s = ptr->unk_32C; - if (script->functionTemp[1].s != 0) { + ptr = script->functionTemp[2]; + if (script->functionTemp[0] == 0) { + script->functionTemp[1] = ptr->unk_32C; + if (script->functionTemp[1] != 0) { hide_popup_menu(); } else { return ApiStatus_BLOCK; } } - script->functionTemp[0].s++; + script->functionTemp[0]++; - if (script->functionTemp[0].s < 15) { + if (script->functionTemp[0] < 15) { return ApiStatus_BLOCK; } destroy_popup_menu(); - if (script->functionTemp[1].s != 0xFF) { - script->varTable[0] = D_8008EF20[ptr->unk_108[script->functionTemp[1].s - 1]][0]; - script->varTable[1] = ptr->unk_108[script->functionTemp[1].s - 1]; + if (script->functionTemp[1] != 0xFF) { + script->varTable[0] = D_8008EF20[ptr->unk_108[script->functionTemp[1] - 1]][0]; + script->varTable[1] = ptr->unk_108[script->functionTemp[1] - 1]; } else { script->varTable[0] = -1; } - heap_free(script->functionTemp[2].s); + heap_free(script->functionTemp[2]); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_08/CAFAC0.c b/src/world/area_flo/flo_08/CAFAC0.c index dfcbb71192..d7528908ed 100644 --- a/src/world/area_flo/flo_08/CAFAC0.c +++ b/src/world/area_flo/flo_08/CAFAC0.c @@ -1050,7 +1050,7 @@ void N(func_80240D80_CAFAC0)(ScriptInstance* script, NpcAISettings* npcAISetting npc->duration = 0xA; npc->currentAnim.w = enemy->animList[8]; } - script->functionTemp[0].s = 0xD; + script->functionTemp[0] = 0xD; } void N(func_80241364_CB00A4)(ScriptInstance* script, NpcAISettings* npcAISettings, EnemyTerritoryThing* territory) { @@ -1062,7 +1062,7 @@ void N(func_80241364_CB00A4)(ScriptInstance* script, NpcAISettings* npcAISetting fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); npc->currentAnim.w = enemy->animList[0]; npc->duration = 25; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } else { if (npc->currentAnim.w != enemy->animList[8]) { if (npc->moveSpeed < 4.0) { @@ -1076,7 +1076,7 @@ void N(func_80241364_CB00A4)(ScriptInstance* script, NpcAISettings* npcAISetting npc->duration--; return; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } } @@ -1087,7 +1087,7 @@ void N(func_802414C8_CB0208)(ScriptInstance* script, NpcAISettings* npcAISetting npc->duration--; if (npc->duration == 0) { - script->functionTemp[0].s = NULL; + script->functionTemp[0] = NULL; } } @@ -1109,7 +1109,7 @@ ApiStatus N(func_8024150C_CB024C)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -1119,13 +1119,13 @@ ApiStatus N(func_8024150C_CB024C)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: diff --git a/src/world/area_flo/flo_09/CB5320.c b/src/world/area_flo/flo_09/CB5320.c index 48e50e2113..20e0db1682 100644 --- a/src/world/area_flo/flo_09/CB5320.c +++ b/src/world/area_flo/flo_09/CB5320.c @@ -95,22 +95,22 @@ void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -138,10 +138,10 @@ void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -163,7 +163,7 @@ void N(func_80240F74_CB5F74)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_8024362C_CB862C)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -204,7 +204,7 @@ ApiStatus N(func_8024162C_CB662C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, npcAISettings, territoryPtr); case 1: diff --git a/src/world/area_flo/flo_13/CC3850.c b/src/world/area_flo/flo_13/CC3850.c index 72fb02abc2..11a075686f 100644 --- a/src/world/area_flo/flo_13/CC3850.c +++ b/src/world/area_flo/flo_13/CC3850.c @@ -1281,22 +1281,22 @@ void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -1324,10 +1324,10 @@ void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -1349,7 +1349,7 @@ void N(func_80240E18_CC4628)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_8024412C_CC793C)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -1391,7 +1391,7 @@ ApiStatus N(func_802414D0_CC4CE0)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -1463,8 +1463,8 @@ void N(func_80241704_CC4F14)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC); if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); @@ -1474,11 +1474,11 @@ void N(func_80241704_CC4F14)(ScriptInstance* script, NpcAISettings* aiSettings, w = 1000.0f; npc_raycast_down_sides(npc->unk_80, &x, &y, &z, &w); npc->moveToPos.y = y + temp_f24; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.point.x, @@ -1511,10 +1511,10 @@ void N(func_80241704_CC4F14)(ScriptInstance* script, NpcAISettings* aiSettings, return; } } - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || (script->functionTemp[1].s == 0)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || (script->functionTemp[1] == 0)) { + script->functionTemp[0] = 0; } } } @@ -1547,18 +1547,18 @@ void N(func_80241B68_CC5378)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } if ((npc->turnAroundYawAdjustment == 0) && (npc->duration <= 0)) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = (rand_int(1000) % 11) + 5; return; } - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } @@ -1585,7 +1585,7 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { N(UnkFunc5)(npc, enemy, script, aiSettings); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } npc->unk_AB = -3; @@ -1597,7 +1597,7 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance* script, s32 isInitialCall) { } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); @@ -1613,7 +1613,7 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance* script, s32 isInitialCall) { break; } - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); enemy->varTable[4] = N(func_802416BC_CC4ECC)(); if (enemy->varTable[4] >= 0) { @@ -1622,11 +1622,11 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance* script, s32 isInitialCall) { enemy2->varTable[11] = enemy->npcID; npc->duration = 15; npc->currentAnim.w = 0x490014; - script->functionTemp[0].s = 30; + script->functionTemp[0] = 30; } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 12: N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); @@ -1639,13 +1639,13 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance* script, s32 isInitialCall) { break; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 30: npc->duration--; if (npc->duration <= 0) { get_enemy(enemy->varTable[4])->varTable[10] = 2; npc->duration = 5; - script->functionTemp[0].s = 31; + script->functionTemp[0] = 31; } case 31: @@ -1654,25 +1654,25 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance* script, s32 isInitialCall) { npc->currentAnim.w = 0x490015; get_enemy(enemy->varTable[4])->varTable[10] = 3; npc->duration = 10; - script->functionTemp[0].s = 32; + script->functionTemp[0] = 32; } case 32: npc->duration--; if (npc->duration <= 0) { npc->duration = 3; - script->functionTemp[0].s = 33; + script->functionTemp[0] = 33; } case 33: npc->duration--; if (npc->duration <= 0) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } break; } - if (((u32)script->functionTemp[0].s - 30) < 2) { + if (((u32)script->functionTemp[0] - 30) < 2) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); dist = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, npc->pos.x, npc->pos.z); if (!is_point_within_region(territoryPtr->shape, territoryPtr->pointX, territoryPtr->pointZ, npc->pos.x, npc->pos.z, @@ -1732,7 +1732,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance* script, s32 isInitialCall) { } if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; enemy->unk_07 = 0; npc->currentAnim.w = enemy->animList[0]; @@ -1745,12 +1745,12 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &var); enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } } @@ -1766,7 +1766,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, aiSettings, territoryPtr); npc->collisionHeight = enemy->varTable[6]; @@ -1869,7 +1869,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) { } if (isInitialCall || (enemy->varTable[10] == 100)) { - script->functionTemp[0].s = 100; + script->functionTemp[0] = 100; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -1891,20 +1891,20 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) { npc->moveSpeed = 0.0f; npc->jumpVelocity = 0.0f; npc->jumpScale = 1.0f; - script->functionTemp[0].s = 102; + script->functionTemp[0] = 102; } else { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &var); npc->currentAnim.w = enemy->animList[0]; - script->functionTemp[1].s = 0; - script->functionTemp[0].s = 200; + script->functionTemp[1] = 0; + script->functionTemp[0] = 200; } } get_screen_coords(0, npc->pos.x, npc->pos.y, npc->pos.z, &x, &y, &z); - if ((script->functionTemp[0].s < 100) && ((x + 50) >= 421)) { - script->functionTemp[0].s = 110; + if ((script->functionTemp[0] < 100) && ((x + 50) >= 421)) { + script->functionTemp[0] = 110; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, aiSettings, territoryPtr); npc->collisionHeight = enemy->varTable[6]; @@ -1963,7 +1963,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) { npc->flags &= ~0x200; npc->renderYaw = 0.0f; npc->currentAnim.w = 0x4A0018; - script->functionTemp[0].s = 101; + script->functionTemp[0] = 101; case 101: if (enemy->varTable[10] != 3) { @@ -1975,7 +1975,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) { npc->jumpVelocity = 8.0f; npc->jumpScale = 0.8f; npc->flags |= 0x800; - script->functionTemp[0].s = 102; + script->functionTemp[0] = 102; case 102: if (npc->moveSpeed > 0.0) { @@ -2021,7 +2021,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); npc->currentAnim.w = 0x4A001A; npc->duration = 3; - script->functionTemp[0].s = 103; + script->functionTemp[0] = 103; break; } } @@ -2034,7 +2034,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) { if (npc->duration <= 0) { npc->flags &= 0xFFFBFFFF; npc->currentAnim.w = 0x4A0001; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } break; @@ -2044,13 +2044,13 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) { npc->pos.z = 0.0f; npc->pos.y = -1000.0f; npc->flags = (npc->flags | 0xA) & ~0x200; - script->functionTemp[0].s = 111; + script->functionTemp[0] = 111; case 111: npc->duration--; if (npc->duration <= 0) { enemy->varTable[10] = 0; - script->functionTemp[0].s = 100; + script->functionTemp[0] = 100; } break; @@ -2069,22 +2069,22 @@ ApiStatus N(func_802433C0_CC6BD0)(ScriptInstance* script, s32 isInitialCall) { s16 param1; s16 param2; - script->functionTemp[1].s = get_variable(script, *script->ptrReadPos); + script->functionTemp[1] = get_variable(script, *script->ptrReadPos); if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == (script->functionTemp[0].s / 5) * 5) { + if (script->functionTemp[0] == (script->functionTemp[0] / 5) * 5) { sfx_get_spatialized_sound_params(npc->pos.x, npc->pos.y, npc->pos.z, ¶m1, ¶m2, 0x200002); sfx_play_sound_with_params(0x295, param1, param2, - update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, script->functionTemp[1].s)); + update_lerp(0, 500.0f, 0.0f, script->functionTemp[0], script->functionTemp[1])); } - script->functionTemp[0].s++; - return (script->functionTemp[1].s < script->functionTemp[0].s) * ApiStatus_DONE2; + script->functionTemp[0]++; + return (script->functionTemp[1] < script->functionTemp[0]) * ApiStatus_DONE2; } ApiStatus N(func_802434D4_CC6CE4)(ScriptInstance* script, s32 isInitialCall) { @@ -2093,17 +2093,17 @@ ApiStatus N(func_802434D4_CC6CE4)(ScriptInstance* script, s32 isInitialCall) { s16 param2; if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - if (script->functionTemp[0].s == (script->functionTemp[0].s / 5) * 5) { + if (script->functionTemp[0] == (script->functionTemp[0] / 5) * 5) { sfx_get_spatialized_sound_params(npc->pos.x, npc->pos.y, npc->pos.z, ¶m1, ¶m2, 0x200002); sfx_play_sound_with_params(0x295, param1, param2, - update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, 0x50)); + update_lerp(0, 500.0f, 0.0f, script->functionTemp[0], 0x50)); } - script->functionTemp[0].s++; - return (script->functionTemp[0].s > 0x50) * ApiStatus_DONE2; + script->functionTemp[0]++; + return (script->functionTemp[0] > 0x50) * ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_14/CCB310.c b/src/world/area_flo/flo_14/CCB310.c index c2cc07c43c..19308eefb8 100644 --- a/src/world/area_flo/flo_14/CCB310.c +++ b/src/world/area_flo/flo_14/CCB310.c @@ -584,10 +584,10 @@ ApiStatus N(func_8024042C_CCB73C)(ScriptInstance* script, s32 isInitialCall) { ApiStatus N(func_8024046C_CCB77C)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; - script->functionTemp[0].s = get_variable(script, *args++); - script->functionTemp[1].s = get_variable(script, *args++); - script->functionTemp[2].s = get_variable(script, *args++); - sfx_adjust_env_sound_pos(0x194, 0, script->functionTemp[0].s, script->functionTemp[1].s, script->functionTemp[2].s); + script->functionTemp[0] = get_variable(script, *args++); + script->functionTemp[1] = get_variable(script, *args++); + script->functionTemp[2] = get_variable(script, *args++); + sfx_adjust_env_sound_pos(0x194, 0, script->functionTemp[0], script->functionTemp[1], script->functionTemp[2]); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_14/CCBE20.c b/src/world/area_flo/flo_14/CCBE20.c index 109aa261cd..45833814e5 100644 --- a/src/world/area_flo/flo_14/CCBE20.c +++ b/src/world/area_flo/flo_14/CCBE20.c @@ -405,22 +405,22 @@ void N(func_80240CC0_CCBFD0)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -448,10 +448,10 @@ void N(func_80240CC0_CCBFD0)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -473,7 +473,7 @@ void N(func_80241764_CCCA74)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_802444C0_CCF7D0)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -515,7 +515,7 @@ ApiStatus N(func_80241E1C_CCD12C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: diff --git a/src/world/area_flo/flo_16/CD1F10.c b/src/world/area_flo/flo_16/CD1F10.c index 68740d52ed..d1866a5eac 100644 --- a/src/world/area_flo/flo_16/CD1F10.c +++ b/src/world/area_flo/flo_16/CD1F10.c @@ -452,8 +452,8 @@ ApiStatus N(func_802402AC_CD20DC)(ScriptInstance* script, s32 isInitialCall) { s32 idx; if (isInitialCall) { - script->functionTemp[2].s = heap_malloc(0x330); - ptr = script->functionTemp[2].s; + script->functionTemp[2] = heap_malloc(0x330); + ptr = script->functionTemp[2]; partnerActiveCount = 0; var = script->varTable[12] >= 0; @@ -483,34 +483,34 @@ ApiStatus N(func_802402AC_CD20DC)(ScriptInstance* script, s32 isInitialCall) { ptr->unk_324 = partnerActiveCount; ptr->unk_328 = 0; create_popup_menu(ptr); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - ptr = script->functionTemp[2].s; - if (script->functionTemp[0].s == 0) { - script->functionTemp[1].s = ptr->unk_32C; - if (script->functionTemp[1].s != 0) { + ptr = script->functionTemp[2]; + if (script->functionTemp[0] == 0) { + script->functionTemp[1] = ptr->unk_32C; + if (script->functionTemp[1] != 0) { hide_popup_menu(); } else { return ApiStatus_BLOCK; } } - script->functionTemp[0].s++; + script->functionTemp[0]++; - if (script->functionTemp[0].s < 15) { + if (script->functionTemp[0] < 15) { return ApiStatus_BLOCK; } destroy_popup_menu(); - if (script->functionTemp[1].s != 0xFF) { - script->varTable[0] = D_8008EF20[ptr->unk_108[script->functionTemp[1].s - 1]][0]; - script->varTable[1] = ptr->unk_108[script->functionTemp[1].s - 1]; + if (script->functionTemp[1] != 0xFF) { + script->varTable[0] = D_8008EF20[ptr->unk_108[script->functionTemp[1] - 1]][0]; + script->varTable[1] = ptr->unk_108[script->functionTemp[1] - 1]; } else { script->varTable[0] = -1; } - heap_free(script->functionTemp[2].s); + heap_free(script->functionTemp[2]); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_16/CD2C80.c b/src/world/area_flo/flo_16/CD2C80.c index 1ab83a8e55..603293197f 100644 --- a/src/world/area_flo/flo_16/CD2C80.c +++ b/src/world/area_flo/flo_16/CD2C80.c @@ -432,22 +432,22 @@ void N(func_80241000_CD2E30)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -475,10 +475,10 @@ void N(func_80241000_CD2E30)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -500,7 +500,7 @@ void N(func_80241AA4_CD38D4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80244010_CD5E40)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -542,7 +542,7 @@ ApiStatus N(func_8024215C_CD3F8C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -586,7 +586,7 @@ void N(func_80242478_CD42A8)(ScriptInstance* script, NpcAISettings* aiSettings, fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); npc->currentAnim.w = enemy->animList[0]; npc->duration = 30; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; enemy->varTable[9] = 30; return; } @@ -616,7 +616,7 @@ void N(func_80242478_CD42A8)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; return; } - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } #include "world/common/UnkFunc45.inc.c" @@ -640,7 +640,7 @@ ApiStatus N(func_80242754_CD4584)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { N(UnkFunc5)(npc, enemy, script, aiSettings); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } npc->unk_AB = -2; @@ -651,7 +651,7 @@ ApiStatus N(func_80242754_CD4584)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: diff --git a/src/world/area_flo/flo_17/CD7350.c b/src/world/area_flo/flo_17/CD7350.c index c6a2b79d5a..dc01024f7f 100644 --- a/src/world/area_flo/flo_17/CD7350.c +++ b/src/world/area_flo/flo_17/CD7350.c @@ -700,22 +700,22 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -743,10 +743,10 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -768,7 +768,7 @@ void N(func_80240CC4_CD7FA4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_8024440C_CDB6EC)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -810,7 +810,7 @@ ApiStatus N(func_8024137C_CD865C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -882,8 +882,8 @@ void N(func_802415B0_CD8890)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 0xC); if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0) != 0) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); @@ -893,11 +893,11 @@ void N(func_802415B0_CD8890)(ScriptInstance* script, NpcAISettings* aiSettings, w = 1000.0f; npc_raycast_down_sides(npc->unk_80, &x, &y, &z, &w); npc->moveToPos.y = y + temp_f24; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.point.x, @@ -930,10 +930,10 @@ void N(func_802415B0_CD8890)(ScriptInstance* script, NpcAISettings* aiSettings, return; } } - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || (script->functionTemp[1].s == 0)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || (script->functionTemp[1] == 0)) { + script->functionTemp[0] = 0; } } } @@ -966,18 +966,18 @@ void N(func_80241A14_CD8CF4)(ScriptInstance* script, NpcAISettings* aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) != 0) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; return; } if ((npc->turnAroundYawAdjustment == 0) && (npc->duration <= 0)) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = (rand_int(1000) % 11) + 5; return; } - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } @@ -1004,7 +1004,7 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { N(UnkFunc5)(npc, enemy, script, aiSettings); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } npc->unk_AB = -3; @@ -1016,7 +1016,7 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance* script, s32 isInitialCall) { } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); @@ -1032,7 +1032,7 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance* script, s32 isInitialCall) { break; } - if (script->functionTemp[0].s == 12) { + if (script->functionTemp[0] == 12) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); enemy->varTable[4] = N(func_80241568_CD8848)(); if (enemy->varTable[4] >= 0) { @@ -1041,11 +1041,11 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance* script, s32 isInitialCall) { enemy2->varTable[11] = enemy->npcID; npc->duration = 15; npc->currentAnim.w = 0x490014; - script->functionTemp[0].s = 30; + script->functionTemp[0] = 30; } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 12: N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); @@ -1058,13 +1058,13 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance* script, s32 isInitialCall) { break; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 30: npc->duration--; if (npc->duration <= 0) { get_enemy(enemy->varTable[4])->varTable[10] = 2; npc->duration = 5; - script->functionTemp[0].s = 31; + script->functionTemp[0] = 31; } case 31: @@ -1073,25 +1073,25 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance* script, s32 isInitialCall) { npc->currentAnim.w = 0x490015; get_enemy(enemy->varTable[4])->varTable[10] = 3; npc->duration = 10; - script->functionTemp[0].s = 32; + script->functionTemp[0] = 32; } case 32: npc->duration--; if (npc->duration <= 0) { npc->duration = 3; - script->functionTemp[0].s = 33; + script->functionTemp[0] = 33; } case 33: npc->duration--; if (npc->duration <= 0) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } break; } - if (((u32)script->functionTemp[0].s - 30) < 2) { + if (((u32)script->functionTemp[0] - 30) < 2) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); dist = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, npc->pos.x, npc->pos.z); if (!is_point_within_region(territoryPtr->shape, territoryPtr->pointX, territoryPtr->pointZ, npc->pos.x, npc->pos.z, @@ -1151,7 +1151,7 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance* script, s32 isInitialCall) { } if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; enemy->unk_07 = 0; npc->currentAnim.w = enemy->animList[0]; @@ -1164,12 +1164,12 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &var); enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } } @@ -1185,7 +1185,7 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, aiSettings, territoryPtr); npc->collisionHeight = enemy->varTable[6]; @@ -1288,7 +1288,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance* script, s32 isInitialCall) { } if (isInitialCall || (enemy->varTable[10] == 100)) { - script->functionTemp[0].s = 100; + script->functionTemp[0] = 100; npc->duration = 0; npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; @@ -1310,20 +1310,20 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance* script, s32 isInitialCall) { npc->moveSpeed = 0.0f; npc->jumpVelocity = 0.0f; npc->jumpScale = 1.0f; - script->functionTemp[0].s = 102; + script->functionTemp[0] = 102; } else { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &var); npc->currentAnim.w = enemy->animList[0]; - script->functionTemp[1].s = 0; - script->functionTemp[0].s = 200; + script->functionTemp[1] = 0; + script->functionTemp[0] = 200; } } get_screen_coords(0, npc->pos.x, npc->pos.y, npc->pos.z, &x, &y, &z); - if ((script->functionTemp[0].s < 100) && ((x + 50) >= 421)) { - script->functionTemp[0].s = 110; + if ((script->functionTemp[0] < 100) && ((x + 50) >= 421)) { + script->functionTemp[0] = 110; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, aiSettings, territoryPtr); npc->collisionHeight = enemy->varTable[6]; @@ -1382,7 +1382,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance* script, s32 isInitialCall) { npc->flags &= ~0x200; npc->renderYaw = 0.0f; npc->currentAnim.w = 0x4A0018; - script->functionTemp[0].s = 101; + script->functionTemp[0] = 101; case 101: if (enemy->varTable[10] != 3) { @@ -1394,7 +1394,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance* script, s32 isInitialCall) { npc->jumpVelocity = 8.0f; npc->jumpScale = 0.8f; npc->flags |= 0x800; - script->functionTemp[0].s = 102; + script->functionTemp[0] = 102; case 102: if (npc->moveSpeed > 0.0) { @@ -1440,7 +1440,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance* script, s32 isInitialCall) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); npc->currentAnim.w = 0x4A001A; npc->duration = 3; - script->functionTemp[0].s = 103; + script->functionTemp[0] = 103; break; } } @@ -1453,7 +1453,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance* script, s32 isInitialCall) { if (npc->duration <= 0) { npc->flags &= 0xFFFBFFFF; npc->currentAnim.w = 0x4A0001; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } break; @@ -1463,13 +1463,13 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance* script, s32 isInitialCall) { npc->pos.z = 0.0f; npc->pos.y = -1000.0f; npc->flags = (npc->flags | 0xA) & ~0x200; - script->functionTemp[0].s = 111; + script->functionTemp[0] = 111; case 111: npc->duration--; if (npc->duration <= 0) { enemy->varTable[10] = 0; - script->functionTemp[0].s = 100; + script->functionTemp[0] = 100; } break; diff --git a/src/world/area_flo/flo_23/CEE2A0.c b/src/world/area_flo/flo_23/CEE2A0.c index 10e632b5ae..446c2b04fe 100644 --- a/src/world/area_flo/flo_23/CEE2A0.c +++ b/src/world/area_flo/flo_23/CEE2A0.c @@ -537,7 +537,7 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance* script, s32 isInitialCall) { } if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; enemy->unk_07 = 0; npc->currentAnim.w = enemy->animList[0]; @@ -550,12 +550,12 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance* script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &var); enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } } @@ -571,7 +571,7 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, aiSettings, territoryPtr); npc->collisionHeight = enemy->varTable[6]; diff --git a/src/world/area_flo/flo_25/CF2C10.c b/src/world/area_flo/flo_25/CF2C10.c index b37a06cab8..844385c760 100644 --- a/src/world/area_flo/flo_25/CF2C10.c +++ b/src/world/area_flo/flo_25/CF2C10.c @@ -595,22 +595,22 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, if (enemy->varTable[9] <= 0) { if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } } else { enemy->varTable[9]--; @@ -638,10 +638,10 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->varTable[4] = npc->pos.y * 100.0; if (aiSettings->moveTime > 0) { if ((npc->duration <= 0) || (--npc->duration <= 0)) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; - if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1] < 3)) { + script->functionTemp[0] = 0; } } } @@ -663,7 +663,7 @@ void N(func_80240C94_CF3864)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_8024291C_CF54EC)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } @@ -705,7 +705,7 @@ ApiStatus N(func_8024134C_CF3F1C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -749,7 +749,7 @@ void N(func_80241668_CF4238)(ScriptInstance* script, NpcAISettings* aiSettings, fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); npc->currentAnim.w = enemy->animList[0]; npc->duration = 30; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; enemy->varTable[9] = 30; return; } @@ -779,7 +779,7 @@ void N(func_80241668_CF4238)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration--; return; } - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } #include "world/common/UnkFunc45.inc.c" @@ -803,7 +803,7 @@ ApiStatus N(func_80241944_CF4514)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { N(UnkFunc5)(npc, enemy, script, aiSettings); - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } npc->unk_AB = -2; @@ -815,7 +815,7 @@ ApiStatus N(func_80241944_CF4514)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: diff --git a/src/world/area_gv/gv_01/E1E460.c b/src/world/area_gv/gv_01/E1E460.c index 7c63100cc0..d4589ecc62 100644 --- a/src/world/area_gv/gv_01/E1E460.c +++ b/src/world/area_gv/gv_01/E1E460.c @@ -18,20 +18,20 @@ ApiStatus func_802405EC_E1EA4C(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; set_curtain_scale_goal(1.0); set_curtain_fade(0); } - script->functionTemp[0].s += 5; - if (script->functionTemp[0].s > 255) { - script->functionTemp[0].s = 255; + script->functionTemp[0] += 5; + if (script->functionTemp[0] > 255) { + script->functionTemp[0] = 255; } set_screen_overlay_color(1, 208, 208, 208); - set_screen_overlay_params_back(0, script->functionTemp[0].s); + set_screen_overlay_params_back(0, script->functionTemp[0]); set_screen_overlay_alpha(1, 0); - return script->functionTemp[0].s == 255; + return script->functionTemp[0] == 255; } INCLUDE_ASM(s32, "world/area_gv/gv_01/E1E460", func_80240688_E1EAE8); diff --git a/src/world/area_hos/hos_02/A17210.c b/src/world/area_hos/hos_02/A17210.c index c8e39fe968..82fd9a0e52 100644 --- a/src/world/area_hos/hos_02/A17210.c +++ b/src/world/area_hos/hos_02/A17210.c @@ -18,7 +18,7 @@ void N(func_80241C44_A17E64)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80244490_A1A6B0)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -63,7 +63,7 @@ ApiStatus N(func_802422FC_A1851C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: N(hos_02_UnkNpcAIFunc23)(script, aiSettings, territoryPtr); case 1: @@ -110,7 +110,7 @@ void N(func_80242618_A18838)(ScriptInstance *script, NpcAISettings *aiSettings, fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); npc->currentAnim = enemy->animList[0]; npc->duration = 30; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; enemy->varTable[9] = 30; return; } @@ -140,7 +140,7 @@ void N(func_80242618_A18838)(ScriptInstance *script, NpcAISettings *aiSettings, npc->duration--; return; } - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } */ diff --git a/src/world/area_hos/hos_03/A1BDB0.c b/src/world/area_hos/hos_03/A1BDB0.c index d6d9728b26..8a891d2bc3 100644 --- a/src/world/area_hos/hos_03/A1BDB0.c +++ b/src/world/area_hos/hos_03/A1BDB0.c @@ -20,7 +20,7 @@ void N(func_80241904_A1CA04)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_802457F4_A208F4)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -65,7 +65,7 @@ ApiStatus N(func_80241FBC_A1D0BC)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_iwa/iwa_01/90FBD0.c b/src/world/area_iwa/iwa_01/90FBD0.c index ebc9bf8ae6..b30eb85b71 100644 --- a/src/world/area_iwa/iwa_01/90FBD0.c +++ b/src/world/area_iwa/iwa_01/90FBD0.c @@ -51,18 +51,18 @@ void N(func_80242498_911B48)(ScriptInstance* script, NpcAISettings* aiSettings, Npc *npc = get_npc_unsafe(enemy->npcID); s32 var; - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { npc->currentAnim = enemy->animList[9]; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->duration = 12; - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } */ @@ -101,7 +101,7 @@ void N(func_80242958_912008)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration < 15) { npc->duration = 15; } - script->functionTemp[0].s = 0x16; + script->functionTemp[0] = 0x16; } } */ @@ -122,7 +122,7 @@ void N(func_80242C48_9122F8)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } */ diff --git a/src/world/area_iwa/iwa_02/915D70.c b/src/world/area_iwa/iwa_02/915D70.c index c4f7c39977..62025e9fbe 100644 --- a/src/world/area_iwa/iwa_02/915D70.c +++ b/src/world/area_iwa/iwa_02/915D70.c @@ -14,18 +14,18 @@ void N(func_802401D4_915F44)(ScriptInstance* script, NpcAISettings* aiSettings, Npc *npc = get_npc_unsafe(enemy->npcID); s32 var; - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { npc->currentAnim = enemy->animList[9]; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->duration = 12; - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } */ @@ -64,7 +64,7 @@ void N(func_80240694_916404)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration < 15) { npc->duration = 15; } - script->functionTemp[0].s = 0x16; + script->functionTemp[0] = 0x16; } } */ @@ -85,7 +85,7 @@ void N(func_80240984_9166F4)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } */ diff --git a/src/world/area_iwa/iwa_03/918EF0.c b/src/world/area_iwa/iwa_03/918EF0.c index 266fe3be43..72a76ede3b 100644 --- a/src/world/area_iwa/iwa_03/918EF0.c +++ b/src/world/area_iwa/iwa_03/918EF0.c @@ -11,18 +11,18 @@ void N(func_80240514_9190C4)(ScriptInstance* script, NpcAISettings* aiSettings, Npc *npc = get_npc_unsafe(enemy->npcID); s32 var; - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { npc->currentAnim = enemy->animList[9]; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->duration = 12; - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } */ @@ -61,7 +61,7 @@ void N(func_802409D4_919584)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration < 15) { npc->duration = 15; } - script->functionTemp[0].s = 0x16; + script->functionTemp[0] = 0x16; } } */ @@ -82,7 +82,7 @@ void N(func_80240CC4_919874)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } */ diff --git a/src/world/area_iwa/iwa_04/91B8E0.c b/src/world/area_iwa/iwa_04/91B8E0.c index 423b0119a3..ad93972481 100644 --- a/src/world/area_iwa/iwa_04/91B8E0.c +++ b/src/world/area_iwa/iwa_04/91B8E0.c @@ -16,18 +16,18 @@ void N(func_80240254_91BB34)(ScriptInstance* script, NpcAISettings* aiSettings, Npc *npc = get_npc_unsafe(enemy->npcID); s32 var; - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { npc->currentAnim = enemy->animList[9]; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); npc->duration = 12; - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } */ @@ -66,7 +66,7 @@ void N(func_80240714_91BFF4)(ScriptInstance* script, NpcAISettings* aiSettings, if (npc->duration < 15) { npc->duration = 15; } - script->functionTemp[0].s = 0x16; + script->functionTemp[0] = 0x16; } } */ @@ -87,7 +87,7 @@ void N(func_80240A04_91C2E4)(ScriptInstance* script, NpcAISettings* aiSettings, } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 0x29; + script->functionTemp[0] = 0x29; } } */ diff --git a/src/world/area_jan/jan_02/B2C8A0.c b/src/world/area_jan/jan_02/B2C8A0.c index bb6883d951..a4ab160290 100644 --- a/src/world/area_jan/jan_02/B2C8A0.c +++ b/src/world/area_jan/jan_02/B2C8A0.c @@ -45,7 +45,7 @@ ApiStatus N(func_80240FC4_B2D434)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -56,11 +56,11 @@ ApiStatus N(func_80240FC4_B2D434)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -74,7 +74,7 @@ ApiStatus N(func_80240FC4_B2D434)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_jan/jan_03/B34BD0.c b/src/world/area_jan/jan_03/B34BD0.c index e84c6a2fbf..cb200f0125 100644 --- a/src/world/area_jan/jan_03/B34BD0.c +++ b/src/world/area_jan/jan_03/B34BD0.c @@ -68,7 +68,7 @@ ApiStatus N(func_802411B4_B35D84)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -79,11 +79,11 @@ ApiStatus N(func_802411B4_B35D84)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -97,7 +97,7 @@ ApiStatus N(func_802411B4_B35D84)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_jan/jan_05/B4B260.c b/src/world/area_jan/jan_05/B4B260.c index f371133284..47683dfd48 100644 --- a/src/world/area_jan/jan_05/B4B260.c +++ b/src/world/area_jan/jan_05/B4B260.c @@ -93,7 +93,7 @@ ApiStatus N(func_80241EE8_B4C958)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -103,18 +103,18 @@ ApiStatus N(func_80241EE8_B4C958)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241AD4_B4C544)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241AD4_B4C544)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -142,12 +142,12 @@ ApiStatus N(func_80241EE8_B4C958)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -181,7 +181,7 @@ ApiStatus N(func_8024219C_B4CC0C)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -191,18 +191,18 @@ ApiStatus N(func_8024219C_B4CC0C)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241AD4_B4C544)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241AD4_B4C544)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -230,12 +230,12 @@ ApiStatus N(func_8024219C_B4CC0C)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_jan/jan_06/B52B40.c b/src/world/area_jan/jan_06/B52B40.c index 297bbe0739..8f37bafed4 100644 --- a/src/world/area_jan/jan_06/B52B40.c +++ b/src/world/area_jan/jan_06/B52B40.c @@ -5,10 +5,10 @@ INCLUDE_ASM(s32, "world/area_jan/jan_06/B52B40", func_80240310_B52B40); ApiStatus N(func_80240310_B52B40)(ScriptInstance *script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; - script->functionTemp[0].s = get_variable(script, *args++); - script->functionTemp[1].s = get_variable(script, *args++); - script->functionTemp[2].s = get_variable(script, *args++); - sfx_adjust_env_sound_pos(0x194, 0, script->functionTemp[0].s, script->functionTemp[1].s, script->functionTemp[2].s); + script->functionTemp[0] = get_variable(script, *args++); + script->functionTemp[1] = get_variable(script, *args++); + script->functionTemp[2] = get_variable(script, *args++); + sfx_adjust_env_sound_pos(0x194, 0, script->functionTemp[0], script->functionTemp[1], script->functionTemp[2]); return ApiStatus_DONE2; } */ diff --git a/src/world/area_jan/jan_06/B52F70.c b/src/world/area_jan/jan_06/B52F70.c index 304a4dfe11..73f4193dba 100644 --- a/src/world/area_jan/jan_06/B52F70.c +++ b/src/world/area_jan/jan_06/B52F70.c @@ -93,7 +93,7 @@ ApiStatus N(func_80241E38_B54668)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -103,18 +103,18 @@ ApiStatus N(func_80241E38_B54668)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241A24_B54254)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241A24_B54254)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -142,12 +142,12 @@ ApiStatus N(func_80241E38_B54668)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -181,7 +181,7 @@ ApiStatus N(func_802420EC_B5491C)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -191,18 +191,18 @@ ApiStatus N(func_802420EC_B5491C)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241A24_B54254)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241A24_B54254)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -230,12 +230,12 @@ ApiStatus N(func_802420EC_B5491C)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_jan/jan_07/B59870.c b/src/world/area_jan/jan_07/B59870.c index 80338e0377..2f3857d322 100644 --- a/src/world/area_jan/jan_07/B59870.c +++ b/src/world/area_jan/jan_07/B59870.c @@ -78,7 +78,7 @@ ApiStatus N(func_80240830_B5A0A0)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -88,18 +88,18 @@ ApiStatus N(func_80240830_B5A0A0)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_8024041C_B59C8C)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_8024041C_B59C8C)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -127,12 +127,12 @@ ApiStatus N(func_80240830_B5A0A0)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -166,7 +166,7 @@ ApiStatus N(func_80240AE4_B5A354)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -176,18 +176,18 @@ ApiStatus N(func_80240AE4_B5A354)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_8024041C_B59C8C)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_8024041C_B59C8C)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -215,12 +215,12 @@ ApiStatus N(func_80240AE4_B5A354)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_jan/jan_08/B5F650.c b/src/world/area_jan/jan_08/B5F650.c index 0c20e4a27e..715abb1f13 100644 --- a/src/world/area_jan/jan_08/B5F650.c +++ b/src/world/area_jan/jan_08/B5F650.c @@ -77,7 +77,7 @@ ApiStatus N(func_80241C84_B5FF34)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -87,18 +87,18 @@ ApiStatus N(func_80241C84_B5FF34)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241870_B5FB20)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241870_B5FB20)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -126,12 +126,12 @@ ApiStatus N(func_80241C84_B5FF34)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -165,7 +165,7 @@ ApiStatus N(func_80241F38_B601E8)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -175,18 +175,18 @@ ApiStatus N(func_80241F38_B601E8)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241870_B5FB20)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241870_B5FB20)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -214,12 +214,12 @@ ApiStatus N(func_80241F38_B601E8)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_jan/jan_09/B663F0.c b/src/world/area_jan/jan_09/B663F0.c index 2b7c5688b1..cc246e5bc8 100644 --- a/src/world/area_jan/jan_09/B663F0.c +++ b/src/world/area_jan/jan_09/B663F0.c @@ -75,7 +75,7 @@ ApiStatus N(func_80241170_B66C20)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -85,18 +85,18 @@ ApiStatus N(func_80241170_B66C20)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240D5C_B6680C)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240D5C_B6680C)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -124,12 +124,12 @@ ApiStatus N(func_80241170_B66C20)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -163,7 +163,7 @@ ApiStatus N(func_80241424_B66ED4)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -173,18 +173,18 @@ ApiStatus N(func_80241424_B66ED4)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240D5C_B6680C)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240D5C_B6680C)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -212,12 +212,12 @@ ApiStatus N(func_80241424_B66ED4)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_jan/jan_12/B73570.c b/src/world/area_jan/jan_12/B73570.c index 90b8b2771c..1cb08bd712 100644 --- a/src/world/area_jan/jan_12/B73570.c +++ b/src/world/area_jan/jan_12/B73570.c @@ -75,7 +75,7 @@ ApiStatus N(func_80240CF0_B73DA0)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -85,18 +85,18 @@ ApiStatus N(func_80240CF0_B73DA0)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_802408DC_B7398C)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_802408DC_B7398C)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -124,12 +124,12 @@ ApiStatus N(func_80240CF0_B73DA0)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: @@ -163,7 +163,7 @@ ApiStatus N(func_80240FA4_B74054)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -173,18 +173,18 @@ ApiStatus N(func_80240FA4_B74054)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_802408DC_B7398C)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_802408DC_B7398C)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -212,12 +212,12 @@ ApiStatus N(func_80240FA4_B74054)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_jan/jan_22/B84180.c b/src/world/area_jan/jan_22/B84180.c index a18d2f1a37..e8897fc27b 100644 --- a/src/world/area_jan/jan_22/B84180.c +++ b/src/world/area_jan/jan_22/B84180.c @@ -48,7 +48,7 @@ ApiStatus N(func_80240B94_B84D14)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -59,11 +59,11 @@ ApiStatus N(func_80240B94_B84D14)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -77,7 +77,7 @@ ApiStatus N(func_80240B94_B84D14)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_kkj/kkj_00/ABB340.c b/src/world/area_kkj/kkj_00/ABB340.c index ff06ed9382..a5202e82b3 100644 --- a/src/world/area_kkj/kkj_00/ABB340.c +++ b/src/world/area_kkj/kkj_00/ABB340.c @@ -43,7 +43,7 @@ ApiStatus N(func_80240C44_ABBED4)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -54,11 +54,11 @@ ApiStatus N(func_80240C44_ABBED4)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -72,7 +72,7 @@ ApiStatus N(func_80240C44_ABBED4)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_kkj/kkj_01/AC5170.c b/src/world/area_kkj/kkj_01/AC5170.c index a01b37430c..40e464e822 100644 --- a/src/world/area_kkj/kkj_01/AC5170.c +++ b/src/world/area_kkj/kkj_01/AC5170.c @@ -48,7 +48,7 @@ ApiStatus N(func_80240B94_AC5D04)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -59,11 +59,11 @@ ApiStatus N(func_80240B94_AC5D04)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -77,7 +77,7 @@ ApiStatus N(func_80240B94_AC5D04)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_kmr/kmr_00/8ABF90.c b/src/world/area_kmr/kmr_00/8ABF90.c index 1c76a555a8..dff55a03e1 100644 --- a/src/world/area_kmr/kmr_00/8ABF90.c +++ b/src/world/area_kmr/kmr_00/8ABF90.c @@ -55,16 +55,16 @@ ApiStatus func_80240BD8_8ACB68(ScriptInstance* script, s32 isInitialCall) { Npc* npc; if (isInitialCall) { - script->functionTemp[1].s = get_variable(script, *args); - npc = get_npc_unsafe(script->functionTemp[1].s); + script->functionTemp[1] = get_variable(script, *args); + npc = get_npc_unsafe(script->functionTemp[1]); sfx_play_sound_at_position(0xB000001E, 0, npc->pos.x, npc->pos.y, npc->pos.z); playFX_11(0, npc->pos.x, npc->pos.y + 20.0f, npc->pos.z, 10.0f); - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } - npc = get_npc_unsafe(script->functionTemp[1].s); - script->functionTemp[0].s--; - if (script->functionTemp[0].s == -1) { + npc = get_npc_unsafe(script->functionTemp[1]); + script->functionTemp[0]--; + if (script->functionTemp[0] == -1) { npc->pos.y = -1000.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_kmr/kmr_05/8CE070.c b/src/world/area_kmr/kmr_05/8CE070.c index 16184fc71c..205735f0a1 100644 --- a/src/world/area_kmr/kmr_05/8CE070.c +++ b/src/world/area_kmr/kmr_05/8CE070.c @@ -21,7 +21,7 @@ void N(func_80240C54_8CECC4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80241B2C_8CFB9C)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ diff --git a/src/world/area_kmr/kmr_06/8D1510.c b/src/world/area_kmr/kmr_06/8D1510.c index 798d2ede5b..a29980e138 100644 --- a/src/world/area_kmr/kmr_06/8D1510.c +++ b/src/world/area_kmr/kmr_06/8D1510.c @@ -21,7 +21,7 @@ void N(func_80240C54_8D2164)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_802420BC_8D35CC)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ diff --git a/src/world/area_kmr/kmr_09/8D5E00.c b/src/world/area_kmr/kmr_09/8D5E00.c index 73dcd02570..cb3a0c46b3 100644 --- a/src/world/area_kmr/kmr_09/8D5E00.c +++ b/src/world/area_kmr/kmr_09/8D5E00.c @@ -21,7 +21,7 @@ void N(func_80240C54_8D6A54)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_8024186C_8D766C)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -66,7 +66,7 @@ ApiStatus N(func_8024130C_8D710C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_kpa/kpa_91/A86A50.c b/src/world/area_kpa/kpa_91/A86A50.c index e446ab1fb9..2653b555c5 100644 --- a/src/world/area_kpa/kpa_91/A86A50.c +++ b/src/world/area_kpa/kpa_91/A86A50.c @@ -46,7 +46,7 @@ ApiStatus N(func_80240B94_A875E4)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -57,11 +57,11 @@ ApiStatus N(func_80240B94_A875E4)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -75,7 +75,7 @@ ApiStatus N(func_80240B94_A875E4)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_kpa/kpa_95/A8CB60.c b/src/world/area_kpa/kpa_95/A8CB60.c index 0087caac3b..ee3781b82e 100644 --- a/src/world/area_kpa/kpa_95/A8CB60.c +++ b/src/world/area_kpa/kpa_95/A8CB60.c @@ -43,7 +43,7 @@ ApiStatus N(func_80240C74_A8D6F4)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -54,11 +54,11 @@ ApiStatus N(func_80240C74_A8D6F4)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -72,7 +72,7 @@ ApiStatus N(func_80240C74_A8D6F4)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_kzn/kzn_02/C5AC20.c b/src/world/area_kzn/kzn_02/C5AC20.c index 6cdca7780e..6b05d762df 100644 --- a/src/world/area_kzn/kzn_02/C5AC20.c +++ b/src/world/area_kzn/kzn_02/C5AC20.c @@ -18,7 +18,7 @@ void N(func_80241134_C5B874)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80244900_C5F040)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -63,7 +63,7 @@ ApiStatus N(func_802417EC_C5BF2C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: @@ -110,7 +110,7 @@ void N(func_80241B08_C5C248)(ScriptInstance *script, NpcAISettings *aiSettings, fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); npc->currentAnim = enemy->animList[0]; npc->duration = 30; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; enemy->varTable[9] = 30; return; } @@ -140,7 +140,7 @@ void N(func_80241B08_C5C248)(ScriptInstance *script, NpcAISettings *aiSettings, npc->duration--; return; } - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } */ @@ -178,7 +178,7 @@ ApiStatus N(func_80241DE4_C5C524)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_kzn/kzn_03/C61020.c b/src/world/area_kzn/kzn_03/C61020.c index c6c7927fc2..4a11d2aae7 100644 --- a/src/world/area_kzn/kzn_03/C61020.c +++ b/src/world/area_kzn/kzn_03/C61020.c @@ -83,7 +83,7 @@ ApiStatus N(func_80241214_C61F24)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -93,18 +93,18 @@ ApiStatus N(func_80241214_C61F24)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240E00_C61B10)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240E00_C61B10)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -132,12 +132,12 @@ ApiStatus N(func_80241214_C61F24)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_kzn/kzn_07/C6EA50.c b/src/world/area_kzn/kzn_07/C6EA50.c index fc6f4b266f..3788ae589e 100644 --- a/src/world/area_kzn/kzn_07/C6EA50.c +++ b/src/world/area_kzn/kzn_07/C6EA50.c @@ -22,7 +22,7 @@ void N(func_80241474_C6F7A4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80242B90_C70EC0)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -67,7 +67,7 @@ ApiStatus N(func_80241B2C_C6FE5C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: @@ -114,7 +114,7 @@ void N(func_80241E48_C70178)(ScriptInstance *script, NpcAISettings *aiSettings, fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); npc->currentAnim = enemy->animList[0]; npc->duration = 30; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; enemy->varTable[9] = 30; return; } @@ -144,7 +144,7 @@ void N(func_80241E48_C70178)(ScriptInstance *script, NpcAISettings *aiSettings, npc->duration--; return; } - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } */ diff --git a/src/world/area_kzn/kzn_08/C71ED0.c b/src/world/area_kzn/kzn_08/C71ED0.c index 44d4f4b4b8..6e7d6bc5ad 100644 --- a/src/world/area_kzn/kzn_08/C71ED0.c +++ b/src/world/area_kzn/kzn_08/C71ED0.c @@ -18,7 +18,7 @@ void N(func_802416A4_C72B24)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80244DA0_C76220)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -63,7 +63,7 @@ ApiStatus N(func_80241D5C_C731DC)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: @@ -110,7 +110,7 @@ void N(func_80242078_C734F8)(ScriptInstance *script, NpcAISettings *aiSettings, fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); npc->currentAnim = enemy->animList[0]; npc->duration = 30; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; enemy->varTable[9] = 30; return; } @@ -140,7 +140,7 @@ void N(func_80242078_C734F8)(ScriptInstance *script, NpcAISettings *aiSettings, npc->duration--; return; } - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } */ @@ -178,7 +178,7 @@ ApiStatus N(func_80242354_C737D4)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: @@ -280,7 +280,7 @@ ApiStatus N(func_80242B58_C73FD8)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -290,18 +290,18 @@ ApiStatus N(func_80242B58_C73FD8)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80242744_C73BC4)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80242744_C73BC4)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -329,12 +329,12 @@ ApiStatus N(func_80242B58_C73FD8)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_kzn/kzn_09/C77D00.c b/src/world/area_kzn/kzn_09/C77D00.c index 389273594f..c98957bec9 100644 --- a/src/world/area_kzn/kzn_09/C77D00.c +++ b/src/world/area_kzn/kzn_09/C77D00.c @@ -71,7 +71,7 @@ ApiStatus N(func_8024163C_C7831C)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -81,18 +81,18 @@ ApiStatus N(func_8024163C_C7831C)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241228_C77F08)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241228_C77F08)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -120,12 +120,12 @@ ApiStatus N(func_8024163C_C7831C)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_kzn/kzn_10/C7E4B0.c b/src/world/area_kzn/kzn_10/C7E4B0.c index 939d9613db..e4016ae654 100644 --- a/src/world/area_kzn/kzn_10/C7E4B0.c +++ b/src/world/area_kzn/kzn_10/C7E4B0.c @@ -19,10 +19,10 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_10/C7E4B0", func_80240638_C7E7B8); ApiStatus N(func_80240638_C7E7B8)(ScriptInstance *script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; - script->functionTemp[0].s = get_variable(script, *args++); - script->functionTemp[1].s = get_variable(script, *args++); - script->functionTemp[2].s = get_variable(script, *args++); - sfx_adjust_env_sound_pos(0x194, 0, script->functionTemp[0].s, script->functionTemp[1].s, script->functionTemp[2].s); + script->functionTemp[0] = get_variable(script, *args++); + script->functionTemp[1] = get_variable(script, *args++); + script->functionTemp[2] = get_variable(script, *args++); + sfx_adjust_env_sound_pos(0x194, 0, script->functionTemp[0], script->functionTemp[1], script->functionTemp[2]); return ApiStatus_DONE2; } */ diff --git a/src/world/area_kzn/kzn_11/C80600.c b/src/world/area_kzn/kzn_11/C80600.c index 8b2c9ea8ad..7fb84f2a10 100644 --- a/src/world/area_kzn/kzn_11/C80600.c +++ b/src/world/area_kzn/kzn_11/C80600.c @@ -18,7 +18,7 @@ void N(func_802410B4_C81254)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_802436D0_C83870)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -63,7 +63,7 @@ ApiStatus N(func_8024176C_C8190C)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: @@ -110,7 +110,7 @@ void N(func_80241A88_C81C28)(ScriptInstance *script, NpcAISettings *aiSettings, fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); npc->currentAnim = enemy->animList[0]; npc->duration = 30; - script->functionTemp[0].s = 20; + script->functionTemp[0] = 20; enemy->varTable[9] = 30; return; } @@ -140,7 +140,7 @@ void N(func_80241A88_C81C28)(ScriptInstance *script, NpcAISettings *aiSettings, npc->duration--; return; } - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } */ @@ -178,7 +178,7 @@ ApiStatus N(func_80241D64_C81F04)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_kzn/kzn_17/C85DC0.c b/src/world/area_kzn/kzn_17/C85DC0.c index cbda4898fb..20e6abfafa 100644 --- a/src/world/area_kzn/kzn_17/C85DC0.c +++ b/src/world/area_kzn/kzn_17/C85DC0.c @@ -71,7 +71,7 @@ ApiStatus N(func_8024092C_C863DC)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -81,18 +81,18 @@ ApiStatus N(func_8024092C_C863DC)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240518_C85FC8)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240518_C85FC8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -120,12 +120,12 @@ ApiStatus N(func_8024092C_C863DC)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_kzn/kzn_17/C887B0.c b/src/world/area_kzn/kzn_17/C887B0.c index 822fed21cb..6f1975b204 100644 --- a/src/world/area_kzn/kzn_17/C887B0.c +++ b/src/world/area_kzn/kzn_17/C887B0.c @@ -19,10 +19,10 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C887B0", func_80243004_C88AB4); ApiStatus N(func_80243004_C88AB4)(ScriptInstance *script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; - script->functionTemp[0].s = get_variable(script, *args++); - script->functionTemp[1].s = get_variable(script, *args++); - script->functionTemp[2].s = get_variable(script, *args++); - sfx_adjust_env_sound_pos(0x194, 0, script->functionTemp[0].s, script->functionTemp[1].s, script->functionTemp[2].s); + script->functionTemp[0] = get_variable(script, *args++); + script->functionTemp[1] = get_variable(script, *args++); + script->functionTemp[2] = get_variable(script, *args++); + sfx_adjust_env_sound_pos(0x194, 0, script->functionTemp[0], script->functionTemp[1], script->functionTemp[2]); return ApiStatus_DONE2; } */ diff --git a/src/world/area_mac/mac_00/7ED280.c b/src/world/area_mac/mac_00/7ED280.c index e87b040e9c..dd4d82cb8a 100644 --- a/src/world/area_mac/mac_00/7ED280.c +++ b/src/world/area_mac/mac_00/7ED280.c @@ -43,7 +43,7 @@ ApiStatus N(func_80243104_7EDE14)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -54,11 +54,11 @@ ApiStatus N(func_80243104_7EDE14)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -72,7 +72,7 @@ ApiStatus N(func_80243104_7EDE14)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_mac/mac_01/8017D0.c b/src/world/area_mac/mac_01/8017D0.c index bab5a0dfd7..9205ad9fc0 100644 --- a/src/world/area_mac/mac_01/8017D0.c +++ b/src/world/area_mac/mac_01/8017D0.c @@ -63,7 +63,7 @@ ApiStatus N(func_80241C14_802494)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -74,11 +74,11 @@ ApiStatus N(func_80241C14_802494)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -92,7 +92,7 @@ ApiStatus N(func_80241C14_802494)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_mac/mac_01/805DD0.c b/src/world/area_mac/mac_01/805DD0.c index 01645b79f6..e3521db436 100644 --- a/src/world/area_mac/mac_01/805DD0.c +++ b/src/world/area_mac/mac_01/805DD0.c @@ -43,7 +43,7 @@ ApiStatus N(func_802460E4_806964)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -54,11 +54,11 @@ ApiStatus N(func_802460E4_806964)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -72,7 +72,7 @@ ApiStatus N(func_802460E4_806964)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_mac/mac_02/823BF0.c b/src/world/area_mac/mac_02/823BF0.c index 4b4ebbe963..46983c5f24 100644 --- a/src/world/area_mac/mac_02/823BF0.c +++ b/src/world/area_mac/mac_02/823BF0.c @@ -45,7 +45,7 @@ ApiStatus N(func_802414C4_824784)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -56,11 +56,11 @@ ApiStatus N(func_802414C4_824784)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -74,7 +74,7 @@ ApiStatus N(func_802414C4_824784)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_mac/mac_05/852170.c b/src/world/area_mac/mac_05/852170.c index ab64873478..733fdb824a 100644 --- a/src/world/area_mac/mac_05/852170.c +++ b/src/world/area_mac/mac_05/852170.c @@ -56,7 +56,7 @@ ApiStatus N(func_80241024_853194)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -67,11 +67,11 @@ ApiStatus N(func_80241024_853194)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -85,7 +85,7 @@ ApiStatus N(func_80241024_853194)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_mgm/mgm_00/E0E7A0.c b/src/world/area_mgm/mgm_00/E0E7A0.c index 9519a2f968..e82d43773c 100644 --- a/src/world/area_mgm/mgm_00/E0E7A0.c +++ b/src/world/area_mgm/mgm_00/E0E7A0.c @@ -60,7 +60,7 @@ ApiStatus N(func_80240E74_E0F614)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -71,11 +71,11 @@ ApiStatus N(func_80240E74_E0F614)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -89,7 +89,7 @@ ApiStatus N(func_80240E74_E0F614)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_mim/mim_01/B93940.c b/src/world/area_mim/mim_01/B93940.c index 3962c489ee..1349dd3de4 100644 --- a/src/world/area_mim/mim_01/B93940.c +++ b/src/world/area_mim/mim_01/B93940.c @@ -71,7 +71,7 @@ ApiStatus N(func_80240B1C_B93F5C)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -81,18 +81,18 @@ ApiStatus N(func_80240B1C_B93F5C)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240708_B93B48)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240708_B93B48)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -120,12 +120,12 @@ ApiStatus N(func_80240B1C_B93F5C)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_mim/mim_05/BA07A0.c b/src/world/area_mim/mim_05/BA07A0.c index dd7d6d2b52..d4afccbf8f 100644 --- a/src/world/area_mim/mim_05/BA07A0.c +++ b/src/world/area_mim/mim_05/BA07A0.c @@ -71,7 +71,7 @@ ApiStatus N(func_8024068C_BA0DBC)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -81,18 +81,18 @@ ApiStatus N(func_8024068C_BA0DBC)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240278_BA09A8)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240278_BA09A8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -120,12 +120,12 @@ ApiStatus N(func_8024068C_BA0DBC)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_mim/mim_06/BA4CF0.c b/src/world/area_mim/mim_06/BA4CF0.c index db73a7d349..166bcd4935 100644 --- a/src/world/area_mim/mim_06/BA4CF0.c +++ b/src/world/area_mim/mim_06/BA4CF0.c @@ -71,7 +71,7 @@ ApiStatus N(func_80240B8C_BA530C)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -81,18 +81,18 @@ ApiStatus N(func_80240B8C_BA530C)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240778_BA4EF8)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240778_BA4EF8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -120,12 +120,12 @@ ApiStatus N(func_80240B8C_BA530C)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_mim/mim_08/BAD940.c b/src/world/area_mim/mim_08/BAD940.c index aba5871f90..1694d8ffba 100644 --- a/src/world/area_mim/mim_08/BAD940.c +++ b/src/world/area_mim/mim_08/BAD940.c @@ -25,7 +25,7 @@ void N(func_80240CF4_BAE634)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_802443C0_BB1D00)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -70,7 +70,7 @@ ApiStatus N(func_802413AC_BAECEC)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: @@ -172,7 +172,7 @@ ApiStatus N(func_80241BB4_BAF4F4)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -182,18 +182,18 @@ ApiStatus N(func_80241BB4_BAF4F4)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_802417A0_BAF0E0)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_802417A0_BAF0E0)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -221,12 +221,12 @@ ApiStatus N(func_80241BB4_BAF4F4)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_nok/nok_02/9D7AA0.c b/src/world/area_nok/nok_02/9D7AA0.c index 92e0153c63..f4cd83e1bd 100644 --- a/src/world/area_nok/nok_02/9D7AA0.c +++ b/src/world/area_nok/nok_02/9D7AA0.c @@ -45,7 +45,7 @@ ApiStatus N(func_80241614_9D8634)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -56,11 +56,11 @@ ApiStatus N(func_80241614_9D8634)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -74,7 +74,7 @@ ApiStatus N(func_80241614_9D8634)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_nok/nok_11/9F4A40.c b/src/world/area_nok/nok_11/9F4A40.c index aac595dfd1..5f962a8afc 100644 --- a/src/world/area_nok/nok_11/9F4A40.c +++ b/src/world/area_nok/nok_11/9F4A40.c @@ -31,7 +31,7 @@ void N(func_80241428_9F5E68)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80242888_9F72C8)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -76,7 +76,7 @@ ApiStatus N(func_80241AE0_9F6520)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_nok/nok_12/9FAD60.c b/src/world/area_nok/nok_12/9FAD60.c index 661ff356b9..3b245648a9 100644 --- a/src/world/area_nok/nok_12/9FAD60.c +++ b/src/world/area_nok/nok_12/9FAD60.c @@ -53,7 +53,7 @@ ApiStatus N(func_802418D8_9FC0C8)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -64,11 +64,11 @@ ApiStatus N(func_802418D8_9FC0C8)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -82,7 +82,7 @@ ApiStatus N(func_802418D8_9FC0C8)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_nok/nok_14/A02A00.c b/src/world/area_nok/nok_14/A02A00.c index d46fcfe844..32c5e8b570 100644 --- a/src/world/area_nok/nok_14/A02A00.c +++ b/src/world/area_nok/nok_14/A02A00.c @@ -28,7 +28,7 @@ void N(func_802415E8_A03E28)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80243A18_A06258)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -73,7 +73,7 @@ ApiStatus N(func_80241CA0_A044E0)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_nok/nok_15/A06F00.c b/src/world/area_nok/nok_15/A06F00.c index 8d13ebb680..e9ec5a9bd9 100644 --- a/src/world/area_nok/nok_15/A06F00.c +++ b/src/world/area_nok/nok_15/A06F00.c @@ -45,7 +45,7 @@ void N(func_80241708_A08608)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80243D5C_A0AC5C)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -90,7 +90,7 @@ ApiStatus N(func_80241DC0_A08CC0)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_omo/omo_01/D9B150.c b/src/world/area_omo/omo_01/D9B150.c index d39bcac9c1..60d9f71560 100644 --- a/src/world/area_omo/omo_01/D9B150.c +++ b/src/world/area_omo/omo_01/D9B150.c @@ -110,7 +110,7 @@ void N(func_80240260_D9B150)(ScriptInstance *script, NpcAISettings *npcAISetting npc->duration = 0xA; npc->currentAnim = enemy->animList[8]; } - script->functionTemp[0].s = 0xD; + script->functionTemp[0] = 0xD; } */ @@ -125,7 +125,7 @@ void N(func_80240844_D9B734)(ScriptInstance *script, NpcAISettings *npcAISetting fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); npc->currentAnim = enemy->animList[0]; npc->duration = 25; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } else { if (npc->currentAnim != enemy->animList[8]) { if (npc->moveSpeed < 4.0) { @@ -139,7 +139,7 @@ void N(func_80240844_D9B734)(ScriptInstance *script, NpcAISettings *npcAISetting npc->duration--; return; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } } @@ -153,7 +153,7 @@ void N(func_802409A8_D9B898)(ScriptInstance *script, NpcAISettings *npcAISetting npc->duration--; if (npc->duration == 0) { - script->functionTemp[0].s = NULL; + script->functionTemp[0] = NULL; } } */ diff --git a/src/world/area_omo/omo_04/DAD400.c b/src/world/area_omo/omo_04/DAD400.c index e3463f1381..9d3a113304 100644 --- a/src/world/area_omo/omo_04/DAD400.c +++ b/src/world/area_omo/omo_04/DAD400.c @@ -54,7 +54,7 @@ void N(func_80240FF4_DAE3F4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80242EF0_DB02F0)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -99,7 +99,7 @@ ApiStatus N(func_802416AC_DAEAAC)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_omo/omo_05/DB22C0.c b/src/world/area_omo/omo_05/DB22C0.c index 55b357a73d..3603be7011 100644 --- a/src/world/area_omo/omo_05/DB22C0.c +++ b/src/world/area_omo/omo_05/DB22C0.c @@ -37,7 +37,7 @@ void N(func_802416A8_DB3968)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80242F88_DB5248)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -82,7 +82,7 @@ ApiStatus N(func_80241D60_DB4020)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_omo/omo_07/DBD2B0.c b/src/world/area_omo/omo_07/DBD2B0.c index 4aa702ef4b..236b016c0f 100644 --- a/src/world/area_omo/omo_07/DBD2B0.c +++ b/src/world/area_omo/omo_07/DBD2B0.c @@ -56,7 +56,7 @@ ApiStatus N(func_80241100_DBE3B0)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -67,11 +67,11 @@ ApiStatus N(func_80241100_DBE3B0)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -85,7 +85,7 @@ ApiStatus N(func_80241100_DBE3B0)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: @@ -152,7 +152,7 @@ void N(func_802425CC_DBF87C)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80243A14_DC0CC4)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -197,7 +197,7 @@ ApiStatus N(func_80242C84_DBFF34)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_omo/omo_09/DCD6B0.c b/src/world/area_omo/omo_09/DCD6B0.c index 10a70fdcf9..01d75a1c4b 100644 --- a/src/world/area_omo/omo_09/DCD6B0.c +++ b/src/world/area_omo/omo_09/DCD6B0.c @@ -53,7 +53,7 @@ ApiStatus N(func_80241AE0_DCE7B0)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -64,11 +64,11 @@ ApiStatus N(func_80241AE0_DCE7B0)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -82,7 +82,7 @@ ApiStatus N(func_80241AE0_DCE7B0)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_omo/omo_17/DEF400.c b/src/world/area_omo/omo_17/DEF400.c index a8f6b4be16..b7345ef889 100644 --- a/src/world/area_omo/omo_17/DEF400.c +++ b/src/world/area_omo/omo_17/DEF400.c @@ -34,7 +34,7 @@ void N(func_80241C08_DF0AA8)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80246184_DF5024)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -79,7 +79,7 @@ ApiStatus N(func_802422C0_DF1160)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_pra/pra_35/D8D270.c b/src/world/area_pra/pra_35/D8D270.c index 516f02ec73..0390944600 100644 --- a/src/world/area_pra/pra_35/D8D270.c +++ b/src/world/area_pra/pra_35/D8D270.c @@ -45,7 +45,7 @@ ApiStatus N(func_80241AB4_D8ED04)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -56,11 +56,11 @@ ApiStatus N(func_80241AB4_D8ED04)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -74,7 +74,7 @@ ApiStatus N(func_80241AB4_D8ED04)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: @@ -184,7 +184,7 @@ ApiStatus N(func_80242698_D8F8E8)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -194,18 +194,18 @@ ApiStatus N(func_80242698_D8F8E8)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241FB8_D8F208)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241FB8_D8F208)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -233,12 +233,12 @@ ApiStatus N(func_80242698_D8F8E8)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_pra/pra_37/D92F40.c b/src/world/area_pra/pra_37/D92F40.c index 225e4a9c03..82bab4ce3b 100644 --- a/src/world/area_pra/pra_37/D92F40.c +++ b/src/world/area_pra/pra_37/D92F40.c @@ -75,7 +75,7 @@ ApiStatus N(func_8024156C_D944AC)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -85,18 +85,18 @@ ApiStatus N(func_8024156C_D944AC)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80241158_D94098)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80241158_D94098)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -124,12 +124,12 @@ ApiStatus N(func_8024156C_D944AC)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_sam/sam_03/D110C0.c b/src/world/area_sam/sam_03/D110C0.c index d3d75db250..66eedc2ba9 100644 --- a/src/world/area_sam/sam_03/D110C0.c +++ b/src/world/area_sam/sam_03/D110C0.c @@ -76,7 +76,7 @@ ApiStatus N(func_8024066C_D1172C)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -86,18 +86,18 @@ ApiStatus N(func_8024066C_D1172C)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240258_D11318)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240258_D11318)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -125,12 +125,12 @@ ApiStatus N(func_8024066C_D1172C)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_sam/sam_05/D187E0.c b/src/world/area_sam/sam_05/D187E0.c index d78c0d6712..e4bc32b3d3 100644 --- a/src/world/area_sam/sam_05/D187E0.c +++ b/src/world/area_sam/sam_05/D187E0.c @@ -74,7 +74,7 @@ ApiStatus N(func_8024061C_D18DFC)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -84,18 +84,18 @@ ApiStatus N(func_8024061C_D18DFC)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240208_D189E8)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240208_D189E8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -123,12 +123,12 @@ ApiStatus N(func_8024061C_D18DFC)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_sam/sam_06/D203E0.c b/src/world/area_sam/sam_06/D203E0.c index 34cf1d7502..ba1180f1c8 100644 --- a/src/world/area_sam/sam_06/D203E0.c +++ b/src/world/area_sam/sam_06/D203E0.c @@ -18,7 +18,7 @@ void N(func_802411A4_D21034)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_802441B8_D24048)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -63,7 +63,7 @@ ApiStatus N(func_8024185C_D216EC)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_sam/sam_07/D2BD30.c b/src/world/area_sam/sam_07/D2BD30.c index f830c3de18..4b3e794e77 100644 --- a/src/world/area_sam/sam_07/D2BD30.c +++ b/src/world/area_sam/sam_07/D2BD30.c @@ -84,7 +84,7 @@ ApiStatus N(func_80240C6C_D2C99C)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -94,18 +94,18 @@ ApiStatus N(func_80240C6C_D2C99C)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240858_D2C588)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240858_D2C588)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -133,12 +133,12 @@ ApiStatus N(func_80240C6C_D2C99C)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_sam/sam_08/D309C0.c b/src/world/area_sam/sam_08/D309C0.c index b6e69a9191..9a5f50870d 100644 --- a/src/world/area_sam/sam_08/D309C0.c +++ b/src/world/area_sam/sam_08/D309C0.c @@ -71,7 +71,7 @@ ApiStatus N(func_8024135C_D30FDC)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -81,18 +81,18 @@ ApiStatus N(func_8024135C_D30FDC)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240F48_D30BC8)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_80240F48_D30BC8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -120,12 +120,12 @@ ApiStatus N(func_8024135C_D30FDC)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_sam/sam_10/D37BD0.c b/src/world/area_sam/sam_10/D37BD0.c index 8c05934ea0..6a52d4ad7c 100644 --- a/src/world/area_sam/sam_10/D37BD0.c +++ b/src/world/area_sam/sam_10/D37BD0.c @@ -71,7 +71,7 @@ ApiStatus N(func_802409EC_D381EC)(ScriptInstance *script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -81,18 +81,18 @@ ApiStatus N(func_802409EC_D381EC)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags & ~0x200) | 0x8; } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } enemy->varTable[0] = 0; } - if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_802405D8_D37DD8)(script)) { - script->functionTemp[0].s = 30; + if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(func_802405D8_D37DD8)(script)) { + script->functionTemp[0] = 30; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: func_800495A0(script, npcAISettings, territoryPtr); case 1: @@ -120,12 +120,12 @@ ApiStatus N(func_802409EC_D381EC)(ScriptInstance *script, s32 isInitialCall) { N(UnkNpcAIFunc6)(script); case 31: N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0].s != 32) { + if (script->functionTemp[0] != 32) { break; } case 32: N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0].s != 33) { + if (script->functionTemp[0] != 33) { break; } case 33: diff --git a/src/world/area_tik/tik_07/87AC00.c b/src/world/area_tik/tik_07/87AC00.c index dc155ceb39..c9f379d0d3 100644 --- a/src/world/area_tik/tik_07/87AC00.c +++ b/src/world/area_tik/tik_07/87AC00.c @@ -22,7 +22,7 @@ void N(func_80242044_87BC24)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80244CB0_87E890)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ diff --git a/src/world/area_trd/trd_02/9A10C0.c b/src/world/area_trd/trd_02/9A10C0.c index f407d1935f..5f3d9b61cf 100644 --- a/src/world/area_trd/trd_02/9A10C0.c +++ b/src/world/area_trd/trd_02/9A10C0.c @@ -53,7 +53,7 @@ ApiStatus N(func_80241448_9A2428)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -64,11 +64,11 @@ ApiStatus N(func_80241448_9A2428)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -82,7 +82,7 @@ ApiStatus N(func_80241448_9A2428)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: diff --git a/src/world/area_trd/trd_04/9A88A0.c b/src/world/area_trd/trd_04/9A88A0.c index 0fda2e52c4..b3c0c780f6 100644 --- a/src/world/area_trd/trd_04/9A88A0.c +++ b/src/world/area_trd/trd_04/9A88A0.c @@ -53,7 +53,7 @@ ApiStatus N(func_80241818_9A9C08)(ScriptInstance* script, s32 isInitialCall) { territory.unk_1C = 0; if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->currentAnim = enemy->animList[0]; npc->flags &= ~0x800; @@ -64,11 +64,11 @@ ApiStatus N(func_80241818_9A9C08)(ScriptInstance* script, s32 isInitialCall) { } if (enemy->unk_B0 & 4) { - script->functionTemp[0].s = 99; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 99; + script->functionTemp[1] = 0; enemy->unk_B0 &= ~4; } else if (enemy->flags & 0x40000000) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; enemy->flags &= ~0x40000000; } @@ -82,7 +82,7 @@ ApiStatus N(func_80241818_9A9C08)(ScriptInstance* script, s32 isInitialCall) { } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc24.inc.c" case 1: @@ -141,7 +141,7 @@ void N(func_80242A6C_9AAE5C)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_802456F4_9ADAE4)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -186,7 +186,7 @@ ApiStatus N(func_80243124_9AB514)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/area_trd/trd_07/9B6C90.c b/src/world/area_trd/trd_07/9B6C90.c index 28a191e87d..cadc59bd11 100644 --- a/src/world/area_trd/trd_07/9B6C90.c +++ b/src/world/area_trd/trd_07/9B6C90.c @@ -28,7 +28,7 @@ void N(func_80241738_9B80B8)(ScriptInstance* script, NpcAISettings* aiSettings, npc->pos.y += N(D_80242EAC_9B982C)[npc->duration++]; if (npc->duration >= 5) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } */ @@ -73,7 +73,7 @@ ApiStatus N(func_80241DF0_9B8770)(ScriptInstance* script, s32 isInitialCall) { enemy->unk_B0 &= ~4; } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: #include "world/common/UnkNpcAIFunc23.inc.c" case 1: diff --git a/src/world/common/Bandit_DropCoin.inc.c b/src/world/common/Bandit_DropCoin.inc.c index 2e2dd2f631..df193fd4fd 100644 --- a/src/world/common/Bandit_DropCoin.inc.c +++ b/src/world/common/Bandit_DropCoin.inc.c @@ -21,14 +21,14 @@ ApiStatus N(Bandit_DropCoin)(ScriptInstance* script, s32 isInitialCall) { npc = (Npc*)npcID; } - script->functionTemp[0].s = (s32)npc; - script->functionTemp[1].s = itemEntityIndex; - script->functionTemp[2].s = areaFlag; + script->functionTemp[0] = (s32)npc; + script->functionTemp[1] = itemEntityIndex; + script->functionTemp[2] = areaFlag; } - npc = (Npc*)script->functionTemp[0].s; - itemEntityIndex = script->functionTemp[1].s; - areaFlag = script->functionTemp[2].s; + npc = (Npc*)script->functionTemp[0]; + itemEntityIndex = script->functionTemp[1]; + areaFlag = script->functionTemp[2]; if (get_variable(script, areaFlag)) { set_item_entity_position(itemEntityIndex, npc->pos.x, npc->pos.y + 30.0f, npc->pos.z); diff --git a/src/world/common/DeadUnkNpcAIFunc14.inc.c b/src/world/common/DeadUnkNpcAIFunc14.inc.c index 90f3c3a71f..6bd8ed4690 100644 --- a/src/world/common/DeadUnkNpcAIFunc14.inc.c +++ b/src/world/common/DeadUnkNpcAIFunc14.inc.c @@ -19,10 +19,10 @@ void N(DeadUnkNpcAIFunc14)(ScriptInstance* script, NpcAISettings* aiSettings) { if (enemy->npcSettings->unk_2A & 2) { npc->duration = 3; - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; } else { npc->duration = 1; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; enemy->unk_10.x = npc->pos.x; enemy->unk_10.y = npc->pos.y; enemy->unk_10.z = npc->pos.z; diff --git a/src/world/common/DeadUnkTexturePanFunc2.inc.c b/src/world/common/DeadUnkTexturePanFunc2.inc.c index 92eb929d20..7f0c9aad74 100644 --- a/src/world/common/DeadUnkTexturePanFunc2.inc.c +++ b/src/world/common/DeadUnkTexturePanFunc2.inc.c @@ -3,13 +3,13 @@ ApiStatus N(DeadUnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 0; - script->functionTemp[1].s = 0; - script->functionTemp[2].s = 0; - script->functionTemp[3].s = 0; + script->functionTemp[0] = 0; + script->functionTemp[1] = 0; + script->functionTemp[2] = 0; + script->functionTemp[3] = 0; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { script->varTable[9] += script->varTable[1]; if (script->varTable[9] < 0) { script->varTable[9] += 0x20000; @@ -18,7 +18,7 @@ ApiStatus N(DeadUnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { } } - if (script->functionTemp[1].s == 0) { + if (script->functionTemp[1] == 0) { script->varTable[10] += script->varTable[2]; if (script->varTable[10] < 0) { script->varTable[10] += 0x20000; @@ -27,7 +27,7 @@ ApiStatus N(DeadUnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { } } - if (script->functionTemp[2].s == 0) { + if (script->functionTemp[2] == 0) { script->varTable[11] += script->varTable[3]; if (script->varTable[11] < 0) { script->varTable[11] += 0x20000; @@ -36,7 +36,7 @@ ApiStatus N(DeadUnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { } } - if (script->functionTemp[3].s == 0) { + if (script->functionTemp[3] == 0) { script->varTable[12] += script->varTable[4]; if (script->varTable[12] < 0) { script->varTable[12] += 0x20000; @@ -50,22 +50,22 @@ ApiStatus N(DeadUnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { func_80126094(script->varTable[0], script->varTable[11]); func_801260AC(script->varTable[0], script->varTable[12]); - script->functionTemp[0].s++; - script->functionTemp[1].s++; - script->functionTemp[2].s++; - script->functionTemp[3].s++; + script->functionTemp[0]++; + script->functionTemp[1]++; + script->functionTemp[2]++; + script->functionTemp[3]++; - if (script->functionTemp[0].s >= script->varTable[5]) { - script->functionTemp[0].s = 0; + if (script->functionTemp[0] >= script->varTable[5]) { + script->functionTemp[0] = 0; } - if (script->functionTemp[1].s >= script->varTable[6]) { - script->functionTemp[1].s = 0; + if (script->functionTemp[1] >= script->varTable[6]) { + script->functionTemp[1] = 0; } - if (script->functionTemp[2].s >= script->varTable[7]) { - script->functionTemp[2].s = 0; + if (script->functionTemp[2] >= script->varTable[7]) { + script->functionTemp[2] = 0; } - if (script->functionTemp[3].s >= script->varTable[8]) { - script->functionTemp[3].s = 0; + if (script->functionTemp[3] >= script->varTable[8]) { + script->functionTemp[3] = 0; } return ApiStatus_BLOCK; diff --git a/src/world/common/NpcJumpFunc.inc.c b/src/world/common/NpcJumpFunc.inc.c index bea712fabb..b983942357 100644 --- a/src/world/common/NpcJumpFunc.inc.c +++ b/src/world/common/NpcJumpFunc.inc.c @@ -11,6 +11,6 @@ void N(NpcJumpFunc)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerr npc->pos.y = npc->moveToPos.y; npc->jumpVelocity = 0.0f; npc->flags &= ~0x800; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } diff --git a/src/world/common/NpcJumpFunc2.inc.c b/src/world/common/NpcJumpFunc2.inc.c index cee9cd2fbb..b9d6cf6899 100644 --- a/src/world/common/NpcJumpFunc2.inc.c +++ b/src/world/common/NpcJumpFunc2.inc.c @@ -10,5 +10,5 @@ void N(NpcJumpFunc2)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTer npc->jumpScale = 2.0f; npc->moveToPos.y = npc->pos.y; npc->flags |= 0x800; - script->functionTemp[0].s = 11; + script->functionTemp[0] = 11; } diff --git a/src/world/common/NpcJumpFunc3.inc.c b/src/world/common/NpcJumpFunc3.inc.c index 70425fc760..f0168a4c36 100644 --- a/src/world/common/NpcJumpFunc3.inc.c +++ b/src/world/common/NpcJumpFunc3.inc.c @@ -8,5 +8,5 @@ void N(NpcJumpFunc3)(ScriptInstance* script) { npc->jumpScale = 2.0f; npc->moveToPos.y = npc->pos.y; npc->flags |= 0x800; - script->functionTemp[0].s = 11; + script->functionTemp[0] = 11; } diff --git a/src/world/common/SomeItemEntityFunc.inc.c b/src/world/common/SomeItemEntityFunc.inc.c index d23f2d2d0a..4bd8902235 100644 --- a/src/world/common/SomeItemEntityFunc.inc.c +++ b/src/world/common/SomeItemEntityFunc.inc.c @@ -3,27 +3,28 @@ ApiStatus N(SomeItemEntityFunc)(ScriptInstance* script, s32 isInitialCall) { ItemEntity* itemEntity = get_item_entity(script->varTable[0]); + f32* y = (f32*) &script->functionTemp[2]; if (isInitialCall) { - script->functionTemp[2].f = itemEntity->position.y; - script->functionTemp[1].s = 0; - script->functionTemp[3].s = 0; + *y = itemEntity->position.y; + script->functionTemp[1] = 0; + script->functionTemp[3] = 0; } - switch (script->functionTemp[1].s) { + switch (script->functionTemp[1]) { case 0: - itemEntity->position.y = script->functionTemp[2].f + ((1.0f - cos_rad((script->functionTemp[3].s * + itemEntity->position.y = *y + ((1.0f - cos_rad((script->functionTemp[3] * (PI / 2)) / 30.0f)) * 20.0f); - if (script->functionTemp[3].s == 30) { - script->functionTemp[1].s = 1; - script->functionTemp[3].s = 0; + if (script->functionTemp[3] == 30) { + script->functionTemp[1] = 1; + script->functionTemp[3] = 0; } else { - script->functionTemp[3].s++; + script->functionTemp[3]++; } break; case 1: - itemEntity->position.y = script->functionTemp[2].f + 17.0f + (cos_deg(script->functionTemp[3].s) * 3.0f); - script->functionTemp[3].s = clamp_angle(script->functionTemp[3].s + 9); + itemEntity->position.y = *y + 17.0f + (cos_deg(script->functionTemp[3]) * 3.0f); + script->functionTemp[3] = clamp_angle(script->functionTemp[3] + 9); break; } diff --git a/src/world/common/UnkDistFunc.inc.c b/src/world/common/UnkDistFunc.inc.c index c2024bfb7f..dc3aace94e 100644 --- a/src/world/common/UnkDistFunc.inc.c +++ b/src/world/common/UnkDistFunc.inc.c @@ -18,7 +18,7 @@ ApiStatus N(UnkDistFunc)(ScriptInstance* script, NpcAISettings* aiSettings, Enem npc->duration = enemy->varTable[3]; } enemy->varTable[4] = npc->duration; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } } } diff --git a/src/world/common/UnkDurationCheck.inc.c b/src/world/common/UnkDurationCheck.inc.c index 5d1e2b4b8a..7366488a2d 100644 --- a/src/world/common/UnkDurationCheck.inc.c +++ b/src/world/common/UnkDurationCheck.inc.c @@ -6,6 +6,6 @@ void N(UnkDurationCheck)(ScriptInstance* script, NpcAISettings* aiSettings, Enem npc->duration--; if (npc->duration <= 0) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } diff --git a/src/world/common/UnkFunc10.inc.c b/src/world/common/UnkFunc10.inc.c index 2100184aaf..ffa75d040a 100644 --- a/src/world/common/UnkFunc10.inc.c +++ b/src/world/common/UnkFunc10.inc.c @@ -32,7 +32,7 @@ void N(UnkFunc10)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrit phi_s1 = 1; } if (phi_s1) { - script->functionTemp[0].s = 4; + script->functionTemp[0] = 4; enemy->unk_07 = 0; } } diff --git a/src/world/common/UnkFunc13.inc.c b/src/world/common/UnkFunc13.inc.c index cd8ac14301..1eba76583a 100644 --- a/src/world/common/UnkFunc13.inc.c +++ b/src/world/common/UnkFunc13.inc.c @@ -8,20 +8,20 @@ void N(UnkFunc13)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrit s32 var; if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } if (npc->turnAroundYawAdjustment == 0) { @@ -31,19 +31,19 @@ void N(UnkFunc13)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrit func_8003D660(npc, 1); } - x = script->functionTemp[2].s[enemy->territory->patrol.points].x; - z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + x = script->functionTemp[2][enemy->territory->patrol.points].x; + z = script->functionTemp[2][enemy->territory->patrol.points].z; npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || - (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { - script->functionTemp[0].s = 4; + (aiSettings->waitTime <= 0) || (script->functionTemp[1] == 0)) { + script->functionTemp[0] = 4; } if (rand_int(10000) % 100 < aiSettings->moveTime) { - script->functionTemp[0].s = 4; + script->functionTemp[0] = 4; } } } diff --git a/src/world/common/UnkFunc13_copy.inc.c b/src/world/common/UnkFunc13_copy.inc.c index f17dd13c5d..d7f85a5d15 100644 --- a/src/world/common/UnkFunc13_copy.inc.c +++ b/src/world/common/UnkFunc13_copy.inc.c @@ -8,20 +8,20 @@ void N(UnkFunc13_copy)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT s32 var; if (aiSettings->unk_14 >= 0) { - if (script->functionTemp[1].s <= 0) { - script->functionTemp[1].s = aiSettings->unk_14; + if (script->functionTemp[1] <= 0) { + script->functionTemp[1] = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } } - script->functionTemp[1].s--; + script->functionTemp[1]--; } if (npc->turnAroundYawAdjustment == 0) { @@ -31,19 +31,19 @@ void N(UnkFunc13_copy)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT func_8003D660(npc, 1); } - x = script->functionTemp[2].s[enemy->territory->patrol.points].x; - z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + x = script->functionTemp[2][enemy->territory->patrol.points].x; + z = script->functionTemp[2][enemy->territory->patrol.points].z; npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { - script->functionTemp[0].s = 2; - script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + script->functionTemp[0] = 2; + script->functionTemp[1] = (rand_int(1000) % 3) + 2; if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || - (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { - script->functionTemp[0].s = 4; + (aiSettings->waitTime <= 0) || (script->functionTemp[1] == 0)) { + script->functionTemp[0] = 4; } if (rand_int(10000) % 100 < aiSettings->moveTime) { - script->functionTemp[0].s = 4; + script->functionTemp[0] = 4; } } } diff --git a/src/world/common/UnkFunc14.inc.c b/src/world/common/UnkFunc14.inc.c index b82ac28ef6..9bcdc878c6 100644 --- a/src/world/common/UnkFunc14.inc.c +++ b/src/world/common/UnkFunc14.inc.c @@ -11,21 +11,21 @@ void N(UnkFunc14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrit npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (!(enemy->npcSettings->unk_2A & 1)) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } } else if (npc->turnAroundYawAdjustment == 0) { npc->duration--; if (npc->duration == 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s != 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] != 0) { if (!(enemy->npcSettings->unk_2A & 0x10)) { npc->yaw = clamp_angle(npc->yaw + 180.0f); } npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); } else { - script->functionTemp[0].s = 4; + script->functionTemp[0] = 4; } } } diff --git a/src/world/common/UnkFunc14_copy.inc.c b/src/world/common/UnkFunc14_copy.inc.c index 198697572c..27f38bc4af 100644 --- a/src/world/common/UnkFunc14_copy.inc.c +++ b/src/world/common/UnkFunc14_copy.inc.c @@ -11,21 +11,21 @@ void N(UnkFunc14_copy)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (!(enemy->npcSettings->unk_2A & 1)) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } } else if (npc->turnAroundYawAdjustment == 0) { npc->duration--; if (npc->duration == 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s != 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] != 0) { if (!(enemy->npcSettings->unk_2A & 0x10)) { npc->yaw = clamp_angle(npc->yaw + 180.0f); } npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); } else { - script->functionTemp[0].s = 4; + script->functionTemp[0] = 4; } } } diff --git a/src/world/common/UnkFunc15.inc.c b/src/world/common/UnkFunc15.inc.c index 103732d810..66ab6c89c7 100644 --- a/src/world/common/UnkFunc15.inc.c +++ b/src/world/common/UnkFunc15.inc.c @@ -10,14 +10,14 @@ ApiStatus N(UnkFunc15)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); npc->currentAnim.w = enemy->animList[0]; npc->duration = 25; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } else { func_8003D660(npc, 1); npc_move_heading(npc, npc->moveSpeed, npc->yaw); if (npc->duration > 0) { npc->duration--; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } } diff --git a/src/world/common/UnkFunc15_copy.inc.c b/src/world/common/UnkFunc15_copy.inc.c index 79e5e9a595..7c2d75a961 100644 --- a/src/world/common/UnkFunc15_copy.inc.c +++ b/src/world/common/UnkFunc15_copy.inc.c @@ -10,14 +10,14 @@ ApiStatus N(UnkFunc15_copy)(ScriptInstance* script, NpcAISettings* aiSettings, E fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); npc->currentAnim.w = enemy->animList[0]; npc->duration = 25; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } else { func_8003D660(npc, 1); npc_move_heading(npc, npc->moveSpeed, npc->yaw); if (npc->duration > 0) { npc->duration--; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } } diff --git a/src/world/common/UnkFunc16.inc.c b/src/world/common/UnkFunc16.inc.c index 5cde3379e3..428c1d1a2e 100644 --- a/src/world/common/UnkFunc16.inc.c +++ b/src/world/common/UnkFunc16.inc.c @@ -6,15 +6,15 @@ void N(UnkFunc16)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrit Npc* npc = get_npc_unsafe(enemy->npcID); s32 i; - for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + for (i = script->functionTemp[2]; i < enemy->territory->patrol.numPoints; i++) { if (i[enemy->territory->patrol.points].y <= npc->pos.y) { - script->functionTemp[2].s = i; + script->functionTemp[2] = i; break; } } npc->moveSpeed = aiSettings->moveSpeed; npc->currentAnim.w = enemy->animList[1]; - script->functionTemp[1].s = 0; - script->functionTemp[0].s = 1; + script->functionTemp[1] = 0; + script->functionTemp[0] = 1; } diff --git a/src/world/common/UnkFunc16_copy.inc.c b/src/world/common/UnkFunc16_copy.inc.c index 55e227e9b8..4b60233c08 100644 --- a/src/world/common/UnkFunc16_copy.inc.c +++ b/src/world/common/UnkFunc16_copy.inc.c @@ -6,15 +6,15 @@ void N(UnkFunc16_copy)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT Npc* npc = get_npc_unsafe(enemy->npcID); s32 i; - for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + for (i = script->functionTemp[2]; i < enemy->territory->patrol.numPoints; i++) { if (i[enemy->territory->patrol.points].y <= npc->pos.y) { - script->functionTemp[2].s = i; + script->functionTemp[2] = i; break; } } npc->moveSpeed = aiSettings->moveSpeed; npc->currentAnim.w = enemy->animList[1]; - script->functionTemp[1].s = 0; - script->functionTemp[0].s = 1; + script->functionTemp[1] = 0; + script->functionTemp[0] = 1; } diff --git a/src/world/common/UnkFunc23.inc.c b/src/world/common/UnkFunc23.inc.c index 4a15454c46..67dbb3e18b 100644 --- a/src/world/common/UnkFunc23.inc.c +++ b/src/world/common/UnkFunc23.inc.c @@ -8,42 +8,42 @@ s32 N(UnkFunc23)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { script->varTable[0] = get_variable(script, *args++); script->varTable[1] = get_variable(script, *args++); - script->functionTemp[0].s = 0; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 0; + script->functionTemp[1] = 0; set_screen_overlay_color(0, 0xD0, 0xD0, 0xD0); } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: - if (script->functionTemp[1].s == 0xFF) { - script->functionTemp[0].s = 1; - script->functionTemp[2].s = 0; + if (script->functionTemp[1] == 0xFF) { + script->functionTemp[0] = 1; + script->functionTemp[2] = 0; } - script->functionTemp[1].s += script->varTable[0]; - if (script->functionTemp[1].s >= 0x100) { - script->functionTemp[1].s = 0xFF; + script->functionTemp[1] += script->varTable[0]; + if (script->functionTemp[1] >= 0x100) { + script->functionTemp[1] = 0xFF; } break; case 1: - script->functionTemp[2].s++; - if (script->functionTemp[2].s >= 2) { - script->functionTemp[0].s = 2; + script->functionTemp[2]++; + if (script->functionTemp[2] >= 2) { + script->functionTemp[0] = 2; } break; case 2: - if (script->functionTemp[1].s == 0) { + if (script->functionTemp[1] == 0) { ret = 1; } - script->functionTemp[1].s -= script->varTable[1]; - if (script->functionTemp[1].s < 0) { - script->functionTemp[1].s = 0; + script->functionTemp[1] -= script->varTable[1]; + if (script->functionTemp[1] < 0) { + script->functionTemp[1] = 0; } break; } - set_screen_overlay_params_front(1, script->functionTemp[1].s); + set_screen_overlay_params_front(1, script->functionTemp[1]); return ret; } diff --git a/src/world/common/UnkFunc31.inc.c b/src/world/common/UnkFunc31.inc.c index cae3df0b3c..08c08403a9 100644 --- a/src/world/common/UnkFunc31.inc.c +++ b/src/world/common/UnkFunc31.inc.c @@ -50,16 +50,16 @@ ApiStatus N(UnkAlphaFunc)(ScriptInstance* script, s32 isInitialCall) { } } - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } - script->functionTemp[0].s += 8; - if (script->functionTemp[0].s > 255) { - script->functionTemp[0].s = 255; + script->functionTemp[0] += 8; + if (script->functionTemp[0] > 255) { + script->functionTemp[0] = 255; } - set_background_color_blend(0, 0, 0, script->functionTemp[0].s); - return (script->functionTemp[0].s == 255) * ApiStatus_DONE2; + set_background_color_blend(0, 0, 0, script->functionTemp[0]); + return (script->functionTemp[0] == 255) * ApiStatus_DONE2; } ApiStatus N(UnkFunc29)(ScriptInstance* script, s32 isInitialCall) { @@ -67,19 +67,19 @@ ApiStatus N(UnkFunc29)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { set_background_color_blend(0, 0, 0, 255); - script->functionTemp[0].s = 255; - script->functionTemp[1].s = 0; + script->functionTemp[0] = 255; + script->functionTemp[1] = 0; } - script->functionTemp[0].s -= 8; - if (script->functionTemp[0].s < 0) { - script->functionTemp[0].s = 0; + script->functionTemp[0] -= 8; + if (script->functionTemp[0] < 0) { + script->functionTemp[0] = 0; } - set_background_color_blend(0, 0, 0, script->functionTemp[0].s); - if (script->functionTemp[0].s == 0 && script->functionTemp[1].s == 0) { - script->functionTemp[1].s = 1; - } else if (script->functionTemp[1].s == 1) { + set_background_color_blend(0, 0, 0, script->functionTemp[0]); + if (script->functionTemp[0] == 0 && script->functionTemp[1] == 0) { + script->functionTemp[1] = 1; + } else if (script->functionTemp[1] == 1) { mdl_set_all_fog_mode(0); *D_801512F0 = 0; diff --git a/src/world/common/UnkFunc4.inc.c b/src/world/common/UnkFunc4.inc.c index 98c314eedc..75a29a435e 100644 --- a/src/world/common/UnkFunc4.inc.c +++ b/src/world/common/UnkFunc4.inc.c @@ -44,9 +44,9 @@ void N(UnkFunc4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrito npc->moveToPos.y = npc->pos.y; ai_enemy_play_sound(npc, 0x2F4, 0x200000); if (enemy->npcSettings->unk_2A & 1) { - script->functionTemp[0].s = 10; + script->functionTemp[0] = 10; } else { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } return; } @@ -55,14 +55,14 @@ void N(UnkFunc4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrito } if ((npc->turnAroundYawAdjustment == 0) && (npc->duration <= 0)) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { if (!(enemy->npcSettings->unk_2A & 0x10)) { npc->yaw = clamp_angle(npc->yaw + 180.0f); } npc->duration = (rand_int(1000) % 11) + 5; } else { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } } diff --git a/src/world/common/UnkFunc41.inc.c b/src/world/common/UnkFunc41.inc.c index 64276d7d28..b472f7e852 100644 --- a/src/world/common/UnkFunc41.inc.c +++ b/src/world/common/UnkFunc41.inc.c @@ -10,22 +10,22 @@ ApiStatus N(UnkFunc41)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { if (gPlayerData.currentPartner == PARTNER_NONE) { - script->functionTemp[0].s = 2; + script->functionTemp[0] = 2; } else { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } - switch (script->functionTemp[0].s) { + switch (script->functionTemp[0]) { case 0: switch_to_partner(0); - script->functionTemp[1].s = 30; - script->functionTemp[0].s = 1; + script->functionTemp[1] = 30; + script->functionTemp[0] = 1; break; case 1: - script->functionTemp[1].s--; - if (script->functionTemp[1].s == -1) { - script->functionTemp[0].s = 2; + script->functionTemp[1]--; + if (script->functionTemp[1] == -1) { + script->functionTemp[0] = 2; } break; case 2: @@ -33,7 +33,7 @@ ApiStatus N(UnkFunc41)(ScriptInstance* script, s32 isInitialCall) { playerData->partners[partnerID].enabled = TRUE; partner_clear_player_tracking(npc); func_800EB2A4(playerData->currentPartner); - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; break; case 3: set_npc_yaw(get_npc_safe(NPC_PARTNER), npc->yaw); diff --git a/src/world/common/UnkFunc45.inc.c b/src/world/common/UnkFunc45.inc.c index a8168923fa..5404dc8f8d 100644 --- a/src/world/common/UnkFunc45.inc.c +++ b/src/world/common/UnkFunc45.inc.c @@ -9,6 +9,6 @@ void N(UnkFunc45)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrit if (npc->duration <= 0) { enemy->varTable[2] = 0; npc->duration = 0; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } diff --git a/src/world/common/UnkFunc5.inc.c b/src/world/common/UnkFunc5.inc.c index ead835195f..aca1a56af1 100644 --- a/src/world/common/UnkFunc5.inc.c +++ b/src/world/common/UnkFunc5.inc.c @@ -7,7 +7,7 @@ void N(UnkFunc5)(Npc* npc, Enemy* enemy, ScriptInstance* script, NpcAISettings* s32 temp_v1; s32 phi_v0; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; temp_v1 = npc->flags & ~0x200; npc->flags = (npc->flags & ~0x200) | 0x800; @@ -26,6 +26,6 @@ void N(UnkFunc5)(Npc* npc, Enemy* enemy, ScriptInstance* script, NpcAISettings* enemy->varTable[9] = 0; enemy->varTable[3] = ((posW * 100.0) + 0.5); enemy->varTable[7] = ((posY * 100.0) + 0.5); - script->functionTemp[1].s = aiSettings->unk_14; + script->functionTemp[1] = aiSettings->unk_14; enemy->unk_B0 |= 0x10; } diff --git a/src/world/common/UnkFunc6.inc.c b/src/world/common/UnkFunc6.inc.c index fe68ccdf94..5821e8e674 100644 --- a/src/world/common/UnkFunc6.inc.c +++ b/src/world/common/UnkFunc6.inc.c @@ -36,10 +36,10 @@ void N(UnkFunc6)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrito temp_f2 = posY + temp_f20; if (temp_f2 <= npc->pos.y) { npc->pos.y = temp_f2; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } else if (npc->pos.y >= npc->moveToPos.y) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } else if (npc->jumpVelocity < 0.0) { npc->duration++; diff --git a/src/world/common/UnkFunc7.inc.c b/src/world/common/UnkFunc7.inc.c index 2841615019..012fd5ede7 100644 --- a/src/world/common/UnkFunc7.inc.c +++ b/src/world/common/UnkFunc7.inc.c @@ -10,7 +10,7 @@ ApiStatus N(UnkFunc7)(ScriptInstance* script, s32 isInitialCall) { s32 func; if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; npc->duration = 0; npc->flags |= 0x102; enemy->flags |= 0x1F300000; @@ -22,7 +22,7 @@ ApiStatus N(UnkFunc7)(ScriptInstance* script, s32 isInitialCall) { } } - func = script->functionTemp[0].s; + func = script->functionTemp[0]; switch (func) { case 0: enemy2 = get_enemy(enemy->npcID - 1); @@ -48,7 +48,7 @@ ApiStatus N(UnkFunc7)(ScriptInstance* script, s32 isInitialCall) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); enemy->flags &= 0xE0EFFFFF; npc->duration = 0; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } break; @@ -65,7 +65,7 @@ ApiStatus N(UnkFunc7)(ScriptInstance* script, s32 isInitialCall) { npc->pos.y = -1000.0f; npc->pos.z = 0.0f; enemy->unk_07 = func; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } break; } diff --git a/src/world/common/UnkFunc8.inc.c b/src/world/common/UnkFunc8.inc.c index 7ba2ae121f..22a5936920 100644 --- a/src/world/common/UnkFunc8.inc.c +++ b/src/world/common/UnkFunc8.inc.c @@ -8,18 +8,18 @@ void N(UnkFunc8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrito if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else { npc->duration--; if (npc->duration <= 0) { - script->functionTemp[1].s--; - if (script->functionTemp[1].s > 0) { + script->functionTemp[1]--; + if (script->functionTemp[1] > 0) { npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); } else { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->duration = 15; - script->functionTemp[0].s = 0x28; + script->functionTemp[0] = 0x28; } } } diff --git a/src/world/common/UnkFunc9.inc.c b/src/world/common/UnkFunc9.inc.c index 11ff6adf82..11abe0c83a 100644 --- a/src/world/common/UnkFunc9.inc.c +++ b/src/world/common/UnkFunc9.inc.c @@ -7,11 +7,11 @@ void N(UnkFunc9)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrito if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { npc->duration = 10; - script->functionTemp[0].s = 50; + script->functionTemp[0] = 50; } else if (npc->turnAroundYawAdjustment == 0) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); diff --git a/src/world/common/UnkMusicFunc.inc.c b/src/world/common/UnkMusicFunc.inc.c index 1dd3abfa4b..ee8ea540cd 100644 --- a/src/world/common/UnkMusicFunc.inc.c +++ b/src/world/common/UnkMusicFunc.inc.c @@ -8,43 +8,43 @@ ApiStatus N(UnkMusicFunc)(ScriptInstance* script, s32 isInitialCall) { f32 dist; if (isInitialCall) { - script->functionTemp[0].s = get_variable(script, *args); - script->functionTemp[1].s = 0; - script->functionTemp[2].s = ((s32*)(script->functionTemp[0].s))[5]; + script->functionTemp[0] = get_variable(script, *args); + script->functionTemp[1] = 0; + script->functionTemp[2] = ((s32*)(script->functionTemp[0]))[5]; } - something = (X32*) script->functionTemp[0].s; + something = (X32*) script->functionTemp[0]; - if (get_variable(script, script->functionTemp[2].s)) { - if (script->functionTemp[1].s != 2) { - script->functionTemp[1].s = 2; + if (get_variable(script, script->functionTemp[2])) { + if (script->functionTemp[1] != 2) { + script->functionTemp[1] = 2; cond = TRUE; } } else { dist = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, something[0].f, something[1].f); - switch (script->functionTemp[1].s) { + switch (script->functionTemp[1]) { case 0: if (dist < something[2].f) { - script->functionTemp[1].s = 1; + script->functionTemp[1] = 1; cond = TRUE; } break; case 1: if (dist > something[3].f) { - script->functionTemp[1].s = 0; + script->functionTemp[1] = 0; cond = TRUE; } break; case 2: - script->functionTemp[1].s = 1; + script->functionTemp[1] = 1; cond = TRUE; break; } } if (cond) { - func_8014AA54(0, something[4].s, script->functionTemp[1].s); + func_8014AA54(0, something[4].s, script->functionTemp[1]); } return ApiStatus_BLOCK; diff --git a/src/world/common/UnkNpcAIFunc1.inc.c b/src/world/common/UnkNpcAIFunc1.inc.c index 19f28682bf..c5250c48f7 100644 --- a/src/world/common/UnkNpcAIFunc1.inc.c +++ b/src/world/common/UnkNpcAIFunc1.inc.c @@ -8,5 +8,5 @@ void N(UnkNpcAIFunc1)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTe npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); npc->currentAnim.w = *enemy->animList; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } diff --git a/src/world/common/UnkNpcAIFunc10.inc.c b/src/world/common/UnkNpcAIFunc10.inc.c index b901d17e06..4a25da126d 100644 --- a/src/world/common/UnkNpcAIFunc10.inc.c +++ b/src/world/common/UnkNpcAIFunc10.inc.c @@ -6,6 +6,6 @@ void N(UnkNpcAIFunc10)(ScriptInstance* script) { npc->duration--; if (npc->duration == 0) { - script->functionTemp[0].s = 15; + script->functionTemp[0] = 15; } } diff --git a/src/world/common/UnkNpcAIFunc11.inc.c b/src/world/common/UnkNpcAIFunc11.inc.c index 82eaa888f8..6f9fbab0a4 100644 --- a/src/world/common/UnkNpcAIFunc11.inc.c +++ b/src/world/common/UnkNpcAIFunc11.inc.c @@ -11,13 +11,13 @@ void N(UnkNpcAIFunc11)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &something); npc->currentAnim.w = enemy->animList[0]; npc->duration = 25; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } else { npc_move_heading(npc, npc->moveSpeed, npc->yaw); func_8003D660(npc, 1); npc->duration--; if (npc->duration == 0) { - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } } diff --git a/src/world/common/UnkNpcAIFunc12.inc.c b/src/world/common/UnkNpcAIFunc12.inc.c index 61cf12bd17..48fac40518 100644 --- a/src/world/common/UnkNpcAIFunc12.inc.c +++ b/src/world/common/UnkNpcAIFunc12.inc.c @@ -29,6 +29,6 @@ void N(UnkNpcAIFunc12)(ScriptInstance* script, NpcAISettings* aiSettings, s32 ar enemy->unk_07 = 0; npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; - script->functionTemp[0].s = 15; + script->functionTemp[0] = 15; } } diff --git a/src/world/common/UnkNpcAIFunc13.inc.c b/src/world/common/UnkNpcAIFunc13.inc.c index 3fd6424751..f5bc041d53 100644 --- a/src/world/common/UnkNpcAIFunc13.inc.c +++ b/src/world/common/UnkNpcAIFunc13.inc.c @@ -25,5 +25,5 @@ void N(UnkNpcAIFunc13)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT } npc->yaw = clamp_angle(tempAngle); - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; } diff --git a/src/world/common/UnkNpcAIFunc13_2.inc.c b/src/world/common/UnkNpcAIFunc13_2.inc.c index 8bae9e51f7..6b406f4f58 100644 --- a/src/world/common/UnkNpcAIFunc13_2.inc.c +++ b/src/world/common/UnkNpcAIFunc13_2.inc.c @@ -25,5 +25,5 @@ void N(UnkNpcAIFunc13_2)(ScriptInstance* script, NpcAISettings* aiSettings, s32 } npc->yaw = clamp_angle(tempAngle); - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; } diff --git a/src/world/common/UnkNpcAIFunc14.inc.c b/src/world/common/UnkNpcAIFunc14.inc.c index 429b7eed01..3ed4f99da9 100644 --- a/src/world/common/UnkNpcAIFunc14.inc.c +++ b/src/world/common/UnkNpcAIFunc14.inc.c @@ -19,10 +19,10 @@ void N(UnkNpcAIFunc14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT if (enemy->npcSettings->unk_2A & 2) { npc->duration = 3; - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; } else { npc->duration = 1; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; enemy->unk_10.x = npc->pos.x; enemy->unk_10.y = npc->pos.y; enemy->unk_10.z = npc->pos.z; diff --git a/src/world/common/UnkNpcAIFunc15.inc.c b/src/world/common/UnkNpcAIFunc15.inc.c index a2bb253098..0efcaf8db4 100644 --- a/src/world/common/UnkNpcAIFunc15.inc.c +++ b/src/world/common/UnkNpcAIFunc15.inc.c @@ -10,6 +10,6 @@ void N(UnkNpcAIFunc15)(ScriptInstance* script, NpcAISettings* aiSettings, s32 ar enemy->jumpScale = 1.5f; enemy->yaw = atan2(enemy->pos.x, enemy->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); enemy->moveSpeed = aiSettings->chaseSpeed; - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; ai_enemy_play_sound(enemy, 0xB0000017, 0); } diff --git a/src/world/common/UnkNpcAIFunc16.inc.c b/src/world/common/UnkNpcAIFunc16.inc.c index e3ee36d79e..65ffc5d939 100644 --- a/src/world/common/UnkNpcAIFunc16.inc.c +++ b/src/world/common/UnkNpcAIFunc16.inc.c @@ -7,5 +7,5 @@ void N(UnkNpcAIFunc16)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT npc->duration = enemy->varTable[10]; npc->currentAnim.w = enemy->animList[13]; - script->functionTemp[0].s = 21; + script->functionTemp[0] = 21; } diff --git a/src/world/common/UnkNpcAIFunc17.inc.c b/src/world/common/UnkNpcAIFunc17.inc.c index daadb0b47a..f4fb83377b 100644 --- a/src/world/common/UnkNpcAIFunc17.inc.c +++ b/src/world/common/UnkNpcAIFunc17.inc.c @@ -9,6 +9,6 @@ void N(UnkNpcAIFunc17)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT if (npc->duration <= 0) { npc->duration = 8; npc->currentAnim.w = enemy->animList[14]; - script->functionTemp[0].s = 52; + script->functionTemp[0] = 52; } } diff --git a/src/world/common/UnkNpcAIFunc18.inc.c b/src/world/common/UnkNpcAIFunc18.inc.c index 50cb08fd94..4ef6b1293c 100644 --- a/src/world/common/UnkNpcAIFunc18.inc.c +++ b/src/world/common/UnkNpcAIFunc18.inc.c @@ -8,8 +8,8 @@ void N(UnkNpcAIFunc18)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT disable_npc_shadow(npc); npc->collisionHeight = 22; npc->collisionRadius = 24; - script->functionTemp[1].s = 0; + script->functionTemp[1] = 0; npc->duration = 0; npc->currentAnim.w = enemy->animList[8]; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } diff --git a/src/world/common/UnkNpcAIFunc19.inc.c b/src/world/common/UnkNpcAIFunc19.inc.c index 665eedfe59..3e04fba084 100644 --- a/src/world/common/UnkNpcAIFunc19.inc.c +++ b/src/world/common/UnkNpcAIFunc19.inc.c @@ -12,6 +12,6 @@ void N(UnkNpcAIFunc19)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT if (npc->turnAroundYawAdjustment == 0 && npc->duration <= 0) { npc->duration = 8; npc->currentAnim.w = enemy->animList[11]; - script->functionTemp[0].s = 51; + script->functionTemp[0] = 51; } } diff --git a/src/world/common/UnkNpcAIFunc1_copy.inc.c b/src/world/common/UnkNpcAIFunc1_copy.inc.c index b3ff4a684a..93a499ad03 100644 --- a/src/world/common/UnkNpcAIFunc1_copy.inc.c +++ b/src/world/common/UnkNpcAIFunc1_copy.inc.c @@ -8,5 +8,5 @@ void N(UnkNpcAIFunc1_copy)(ScriptInstance* script, NpcAISettings* aiSettings, En npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); npc->currentAnim.w = *enemy->animList; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } diff --git a/src/world/common/UnkNpcAIFunc2.inc.c b/src/world/common/UnkNpcAIFunc2.inc.c index 881f81853c..41479e9c3d 100644 --- a/src/world/common/UnkNpcAIFunc2.inc.c +++ b/src/world/common/UnkNpcAIFunc2.inc.c @@ -9,5 +9,5 @@ void N(UnkNpcAIFunc2)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTe npc->duration = 0; npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); npc->currentAnim.w = enemy->animList[8]; - script->functionTemp[0].s = 11; + script->functionTemp[0] = 11; } diff --git a/src/world/common/UnkNpcAIFunc20.inc.c b/src/world/common/UnkNpcAIFunc20.inc.c index ca5af0032d..31683b1371 100644 --- a/src/world/common/UnkNpcAIFunc20.inc.c +++ b/src/world/common/UnkNpcAIFunc20.inc.c @@ -9,6 +9,6 @@ void N(UnkNpcAIFunc20)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); npc->collisionHeight = 26; npc->collisionRadius = 24; - script->functionTemp[0].s = 4; + script->functionTemp[0] = 4; } } diff --git a/src/world/common/UnkNpcAIFunc21.inc.c b/src/world/common/UnkNpcAIFunc21.inc.c index 1e78812208..458cc5588a 100644 --- a/src/world/common/UnkNpcAIFunc21.inc.c +++ b/src/world/common/UnkNpcAIFunc21.inc.c @@ -11,6 +11,6 @@ void N(UnkNpcAIFunc21)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT enable_npc_shadow(npc); npc->currentAnim.w = enemy->animList[10]; npc->duration = 8; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } } diff --git a/src/world/common/UnkNpcAIFunc22.inc.c b/src/world/common/UnkNpcAIFunc22.inc.c index 62e3838d03..38de9ca8bd 100644 --- a/src/world/common/UnkNpcAIFunc22.inc.c +++ b/src/world/common/UnkNpcAIFunc22.inc.c @@ -7,6 +7,6 @@ void N(UnkNpcAIFunc22)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); npc->currentAnim.w = enemy->animList[0]; - script->functionTemp[1].s = rand_int(1000) % 2 + 2; - script->functionTemp[0].s = 5; + script->functionTemp[1] = rand_int(1000) % 2 + 2; + script->functionTemp[0] = 5; } diff --git a/src/world/common/UnkNpcAIFunc23.inc.c b/src/world/common/UnkNpcAIFunc23.inc.c index 7c4738e693..aae9ce641e 100644 --- a/src/world/common/UnkNpcAIFunc23.inc.c +++ b/src/world/common/UnkNpcAIFunc23.inc.c @@ -15,12 +15,12 @@ void N(UnkNpcAIFunc23)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } npc->currentAnim.w = enemy->animList[1]; - script->functionTemp[1].s = 0; + script->functionTemp[1] = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } enemy->varTable[4] = npc->pos.y * 100.0; - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } diff --git a/src/world/common/UnkNpcAIFunc24.inc.c b/src/world/common/UnkNpcAIFunc24.inc.c index cc5cd8151c..66154ebcb5 100644 --- a/src/world/common/UnkNpcAIFunc24.inc.c +++ b/src/world/common/UnkNpcAIFunc24.inc.c @@ -11,17 +11,17 @@ void N(UnkNpcAIFunc24)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT s32 i; s32 j; - script->functionTemp[1].s = 0; + script->functionTemp[1] = 0; max = 32767.0f; posX = npc->pos.x; posZ = npc->pos.z; - script->functionTemp[2].s = 0; + script->functionTemp[2] = 0; for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); if (ret < max) { max = ret; - script->functionTemp[2].s = j; + script->functionTemp[2] = j; } } @@ -32,5 +32,5 @@ void N(UnkNpcAIFunc24)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } diff --git a/src/world/common/UnkNpcAIFunc25.inc.c b/src/world/common/UnkNpcAIFunc25.inc.c index d9aab1fa54..8579c98123 100644 --- a/src/world/common/UnkNpcAIFunc25.inc.c +++ b/src/world/common/UnkNpcAIFunc25.inc.c @@ -5,9 +5,9 @@ void N(UnkNpcAIFunc25)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - script->functionTemp[2].s++; - if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { - script->functionTemp[2].s = 0; + script->functionTemp[2]++; + if (script->functionTemp[2] >= enemy->territory->patrol.numPoints) { + script->functionTemp[2] = 0; } npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { @@ -15,5 +15,5 @@ void N(UnkNpcAIFunc25)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT } else { npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; } - script->functionTemp[0].s = 1; + script->functionTemp[0] = 1; } diff --git a/src/world/common/UnkNpcAIFunc3.inc.c b/src/world/common/UnkNpcAIFunc3.inc.c index 9255e8d0d2..5ef55eb62c 100644 --- a/src/world/common/UnkNpcAIFunc3.inc.c +++ b/src/world/common/UnkNpcAIFunc3.inc.c @@ -7,7 +7,7 @@ void N(UnkNpcAIFunc3)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTe if ((npc->duration <= 0) || (--npc->duration <= 0)) { if (npc->turnAroundYawAdjustment == 0) { npc->duration = 0; - script->functionTemp[0].s = 14; + script->functionTemp[0] = 14; } } } diff --git a/src/world/common/UnkNpcAIFunc4.inc.c b/src/world/common/UnkNpcAIFunc4.inc.c index fde0209fc1..000042da1c 100644 --- a/src/world/common/UnkNpcAIFunc4.inc.c +++ b/src/world/common/UnkNpcAIFunc4.inc.c @@ -8,5 +8,5 @@ void N(UnkNpcAIFunc4)(ScriptInstance* script) { npc->duration = 0; set_npc_yaw(npc, 270.0f); enemy->varTable[0] = 0; - script->functionTemp[0].s = 3; + script->functionTemp[0] = 3; } diff --git a/src/world/common/UnkNpcAIFunc5.inc.c b/src/world/common/UnkNpcAIFunc5.inc.c index bf09c5f711..5085f6db89 100644 --- a/src/world/common/UnkNpcAIFunc5.inc.c +++ b/src/world/common/UnkNpcAIFunc5.inc.c @@ -8,6 +8,6 @@ void N(UnkNpcAIFunc5)(ScriptInstance* script) { npc->duration--; if (npc->duration <= 0) { enemy->varTable[0] = 0; - script->functionTemp[0].s = 12; + script->functionTemp[0] = 12; } } diff --git a/src/world/common/UnkNpcAIFunc6.inc.c b/src/world/common/UnkNpcAIFunc6.inc.c index d523eec792..4340e25919 100644 --- a/src/world/common/UnkNpcAIFunc6.inc.c +++ b/src/world/common/UnkNpcAIFunc6.inc.c @@ -10,6 +10,6 @@ void N(UnkNpcAIFunc6)(ScriptInstance* script) { enemy->varTable[0] = 2; npc->duration = enemy->varTable[1]; npc->currentAnim.w = enemy->animList[8]; - script->functionTemp[0].s = 31; + script->functionTemp[0] = 31; } } diff --git a/src/world/common/UnkNpcAIFunc7.inc.c b/src/world/common/UnkNpcAIFunc7.inc.c index d174ff6d22..8909a87dc4 100644 --- a/src/world/common/UnkNpcAIFunc7.inc.c +++ b/src/world/common/UnkNpcAIFunc7.inc.c @@ -10,6 +10,6 @@ void N(UnkNpcAIFunc7)(ScriptInstance* script) { enemy->varTable[0] = 3; npc->duration = enemy->varTable[2]; npc->currentAnim.w = enemy->animList[9]; - script->functionTemp[0].s = 32; + script->functionTemp[0] = 32; } } diff --git a/src/world/common/UnkNpcAIFunc8.inc.c b/src/world/common/UnkNpcAIFunc8.inc.c index f0ded025d1..083443d964 100644 --- a/src/world/common/UnkNpcAIFunc8.inc.c +++ b/src/world/common/UnkNpcAIFunc8.inc.c @@ -15,6 +15,6 @@ void N(UnkNpcAIFunc8)(ScriptInstance* script) { fx_emote(3, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, enemy->varTable[3] - 1, &something); } - script->functionTemp[0].s = 33; + script->functionTemp[0] = 33; } } diff --git a/src/world/common/UnkNpcAIFunc9.inc.c b/src/world/common/UnkNpcAIFunc9.inc.c index 0b0a2216b1..6f10dc58da 100644 --- a/src/world/common/UnkNpcAIFunc9.inc.c +++ b/src/world/common/UnkNpcAIFunc9.inc.c @@ -11,6 +11,6 @@ void N(UnkNpcAIFunc9)(ScriptInstance* script) { if (enemy2->varTable[0] == 0) { npc->currentAnim.w = enemy->animList[0]; npc->duration = enemy->varTable[2]; - script->functionTemp[0].s = 33; + script->functionTemp[0] = 33; } } diff --git a/src/world/common/UnkNpcDurationFlagFunc.inc.c b/src/world/common/UnkNpcDurationFlagFunc.inc.c index 8c3641a967..b33c8e9044 100644 --- a/src/world/common/UnkNpcDurationFlagFunc.inc.c +++ b/src/world/common/UnkNpcDurationFlagFunc.inc.c @@ -8,9 +8,9 @@ void N(UnkNpcDurationFlagFunc)(ScriptInstance* script, NpcAISettings* aiSettings npc->duration--; if (npc->duration == 0) { if (enemy->unk_B0 & 0x80) { - script->functionTemp[0].s = 15; + script->functionTemp[0] = 15; } else { - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } } } diff --git a/src/world/common/UnkPartnerFuncs.inc.c b/src/world/common/UnkPartnerFuncs.inc.c index 81770ce0df..a63b7097f9 100644 --- a/src/world/common/UnkPartnerFuncs.inc.c +++ b/src/world/common/UnkPartnerFuncs.inc.c @@ -5,7 +5,7 @@ ApiStatus N(UnkRotatePartner)(ScriptInstance* script, s32 isInitialCall) { Npc* partner = get_npc_unsafe(NPC_PARTNER); if (isInitialCall) { - script->functionTemp[0].s = 60; + script->functionTemp[0] = 60; } partner->yaw += 30.0f; @@ -13,25 +13,28 @@ ApiStatus N(UnkRotatePartner)(ScriptInstance* script, s32 isInitialCall) { partner->yaw -= 360.0f; } - script->functionTemp[0].s--; + script->functionTemp[0]--; - return (script->functionTemp[0].s >> 0x1F) & ApiStatus_DONE2; + return (script->functionTemp[0] >> 0x1F) & ApiStatus_DONE2; } ApiStatus N(UnkMovePartner)(ScriptInstance* script, s32 isInitialCall) { Npc* npc = get_npc_unsafe(NPC_PARTNER); + f32* x = (f32*) &script->functionTemp[1]; + f32* y = (f32*) &script->functionTemp[2]; + f32* z = (f32*) &script->functionTemp[3]; if (isInitialCall) { - script->functionTemp[1].f = get_float_variable(script, SI_VAR(0)) / 60.0f; - script->functionTemp[2].f = get_float_variable(script, SI_VAR(5)) / 60.0f; - script->functionTemp[3].f = get_float_variable(script, SI_VAR(1)) / 60.0f; - script->functionTemp[0].s = 60; + *x = get_float_variable(script, SI_VAR(0)) / 60.0f; + *y = get_float_variable(script, SI_VAR(5)) / 60.0f; + *z = get_float_variable(script, SI_VAR(1)) / 60.0f; + script->functionTemp[0] = 60; } - npc->pos.x += script->functionTemp[1].f; - npc->pos.y += script->functionTemp[2].f; - npc->pos.z += script->functionTemp[3].f; - script->functionTemp[0].s--; + npc->pos.x += *x; + npc->pos.y += *y; + npc->pos.z += *z; + script->functionTemp[0]--; - return (script->functionTemp[0].s == 0) * ApiStatus_DONE2; + return (script->functionTemp[0] == 0) * ApiStatus_DONE2; } diff --git a/src/world/common/UnkRotatePlayer.inc.c b/src/world/common/UnkRotatePlayer.inc.c index 742a21a125..d164665e50 100644 --- a/src/world/common/UnkRotatePlayer.inc.c +++ b/src/world/common/UnkRotatePlayer.inc.c @@ -5,7 +5,7 @@ ApiStatus N(UnkRotatePlayer)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; if (isInitialCall) { - script->functionTemp[0].s = 60; + script->functionTemp[0] = 60; } playerStatus->targetYaw += 30.0f; @@ -13,7 +13,7 @@ ApiStatus N(UnkRotatePlayer)(ScriptInstance* script, s32 isInitialCall) { playerStatus->targetYaw -= 360.0f; } - script->functionTemp[0].s--; + script->functionTemp[0]--; - return (script->functionTemp[0].s >> 0x1F) & ApiStatus_DONE2; + return (script->functionTemp[0] >> 0x1F) & ApiStatus_DONE2; } diff --git a/src/world/common/UnkSetDurationFunc.inc.c b/src/world/common/UnkSetDurationFunc.inc.c index e4fd9c7d00..7e02abe6bc 100644 --- a/src/world/common/UnkSetDurationFunc.inc.c +++ b/src/world/common/UnkSetDurationFunc.inc.c @@ -5,5 +5,5 @@ void N(UnkSetDurationFunc)(ScriptInstance* script) { Enemy* enemy = script->owner1.enemy; get_npc_unsafe(enemy->npcID)->duration = enemy->varTable[2]; - script->functionTemp[0].s = 33; + script->functionTemp[0] = 33; } diff --git a/src/world/common/UnkTexturePanFunc2.inc.c b/src/world/common/UnkTexturePanFunc2.inc.c index 84b7125ac8..7f0f023b98 100644 --- a/src/world/common/UnkTexturePanFunc2.inc.c +++ b/src/world/common/UnkTexturePanFunc2.inc.c @@ -3,13 +3,13 @@ ApiStatus N(UnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall) { - script->functionTemp[0].s = 0; - script->functionTemp[1].s = 0; - script->functionTemp[2].s = 0; - script->functionTemp[3].s = 0; + script->functionTemp[0] = 0; + script->functionTemp[1] = 0; + script->functionTemp[2] = 0; + script->functionTemp[3] = 0; } - if (script->functionTemp[0].s == 0) { + if (script->functionTemp[0] == 0) { script->varTable[9] += script->varTable[1]; if (script->varTable[9] < 0) { script->varTable[9] += 0x20000; @@ -18,7 +18,7 @@ ApiStatus N(UnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { } } - if (script->functionTemp[1].s == 0) { + if (script->functionTemp[1] == 0) { script->varTable[10] += script->varTable[2]; if (script->varTable[10] < 0) { script->varTable[10] += 0x20000; @@ -27,7 +27,7 @@ ApiStatus N(UnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { } } - if (script->functionTemp[2].s == 0) { + if (script->functionTemp[2] == 0) { script->varTable[11] += script->varTable[3]; if (script->varTable[11] < 0) { script->varTable[11] += 0x20000; @@ -36,7 +36,7 @@ ApiStatus N(UnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { } } - if (script->functionTemp[3].s == 0) { + if (script->functionTemp[3] == 0) { script->varTable[12] += script->varTable[4]; if (script->varTable[12] < 0) { script->varTable[12] += 0x20000; @@ -50,22 +50,22 @@ ApiStatus N(UnkTexturePanFunc2)(ScriptInstance* script, s32 isInitialCall) { set_aux_pan_u(script->varTable[0], script->varTable[11]); set_aux_pan_v(script->varTable[0], script->varTable[12]); - script->functionTemp[0].s++; - script->functionTemp[1].s++; - script->functionTemp[2].s++; - script->functionTemp[3].s++; + script->functionTemp[0]++; + script->functionTemp[1]++; + script->functionTemp[2]++; + script->functionTemp[3]++; - if (script->functionTemp[0].s >= script->varTable[5]) { - script->functionTemp[0].s = 0; + if (script->functionTemp[0] >= script->varTable[5]) { + script->functionTemp[0] = 0; } - if (script->functionTemp[1].s >= script->varTable[6]) { - script->functionTemp[1].s = 0; + if (script->functionTemp[1] >= script->varTable[6]) { + script->functionTemp[1] = 0; } - if (script->functionTemp[2].s >= script->varTable[7]) { - script->functionTemp[2].s = 0; + if (script->functionTemp[2] >= script->varTable[7]) { + script->functionTemp[2] = 0; } - if (script->functionTemp[3].s >= script->varTable[8]) { - script->functionTemp[3].s = 0; + if (script->functionTemp[3] >= script->varTable[8]) { + script->functionTemp[3] = 0; } return ApiStatus_BLOCK; diff --git a/src/world/common/set_script_owner_npc_anim.inc.c b/src/world/common/set_script_owner_npc_anim.inc.c index 4fc1fec4f2..741b7d76e9 100644 --- a/src/world/common/set_script_owner_npc_anim.inc.c +++ b/src/world/common/set_script_owner_npc_anim.inc.c @@ -8,5 +8,5 @@ void N(set_script_owner_npc_anim)(ScriptInstance* script, NpcAISettings* aiSetti npc->currentAnim.w = enemy->animList[8]; npc->duration = enemy->varTable[2]; npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - script->functionTemp[0].s = 13; + script->functionTemp[0] = 13; } diff --git a/src/world/common/set_script_owner_npc_col_height.inc.c b/src/world/common/set_script_owner_npc_col_height.inc.c index b79f45cba1..b847c19fe9 100644 --- a/src/world/common/set_script_owner_npc_col_height.inc.c +++ b/src/world/common/set_script_owner_npc_col_height.inc.c @@ -16,5 +16,5 @@ void N(set_script_owner_npc_col_height)(ScriptInstance* script, NpcAISettings* a } npc->collisionHeight = enemy->varTable[6]; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } diff --git a/src/world/script_api/7E0E80.c b/src/world/script_api/7E0E80.c index 51da863fce..dda1d6d0a6 100644 --- a/src/world/script_api/7E0E80.c +++ b/src/world/script_api/7E0E80.c @@ -73,7 +73,7 @@ s32 shop_owner_continue_speech(s32 messageIndex) { script->varTable[0] = shopStringID; script->varTable[1] = shop->owner->npcID; script->varTable[2] = shop->owner->talkAnim; - script->functionTemp[3].s = script->varTable[3] = shop->owner->idleAnim; + script->functionTemp[3] = script->varTable[3] = shop->owner->idleAnim; return script->id; } @@ -98,7 +98,7 @@ s32 shop_owner_continue_speech_with_quantity(s32 messageIndex, s32 amount) { script->varTable[0] = shopStringID; script->varTable[1] = shop->owner->npcID; script->varTable[2] = shop->owner->talkAnim; - script->functionTemp[3].s = script->varTable[3] = shop->owner->idleAnim; + script->functionTemp[3] = script->varTable[3] = shop->owner->idleAnim; return script->id; } @@ -111,7 +111,7 @@ s32 shop_owner_reset_speech(s32 messageIndex) { script->varTable[0] = shopStringID; script->varTable[1] = shop->owner->npcID; script->varTable[2] = shop->owner->talkAnim; - script->functionTemp[3].s = script->varTable[3] = shop->owner->idleAnim; + script->functionTemp[3] = script->varTable[3] = shop->owner->idleAnim; return script->id; } @@ -122,7 +122,7 @@ s32 shop_owner_end_speech(void) { script->varTable[0] = shop->owner->npcID; script->varTable[1] = shop->owner->talkAnim; - script->functionTemp[3].s = script->varTable[2] = shop->owner->idleAnim; + script->functionTemp[3] = script->varTable[2] = shop->owner->idleAnim; return script->id; } diff --git a/src/world/script_api/7E2AA0.c b/src/world/script_api/7E2AA0.c index 65858c8d48..6f1df66ef7 100644 --- a/src/world/script_api/7E2AA0.c +++ b/src/world/script_api/7E2AA0.c @@ -41,17 +41,17 @@ INCLUDE_ASM(ApiStatus, "world/script_api/7E2AA0", MakeDoorAdvanced, ScriptInstan INCLUDE_ASM(s32, "world/script_api/7E2AA0", func_802822A8); ApiStatus func_80282314(ScriptInstance* script, s32 isInitialCall) { - script->functionTemp[1].s = script->varTable[1]; + script->functionTemp[1] = script->varTable[1]; return ApiStatus_DONE2; } ApiStatus func_80282324(ScriptInstance* script, s32 isInitialCall) { - script->varTable[0] = *(UNK_TYPE*)script->functionTemp[1].s; + script->varTable[0] = *(UNK_TYPE*)script->functionTemp[1]; return ApiStatus_DONE2; } ApiStatus func_80282338(ScriptInstance* script, s32 isInitialCall) { - UNK_TYPE* temp_s0 = script->functionTemp[1].s; + UNK_TYPE* temp_s0 = script->functionTemp[1]; *temp_s0 = get_variable(script, *script->ptrReadPos); return ApiStatus_DONE2; @@ -106,7 +106,7 @@ INCLUDE_ASM(s32, "world/script_api/7E2AA0", func_80282634); INCLUDE_ASM(s32, "world/script_api/7E2AA0", func_80282700); ApiStatus func_80282774(ScriptInstance* script, s32 isInitialCall) { - DoorStuff* doorStuff = (DoorStuff*)script->functionTemp[1].s; + DoorStuff* doorStuff = (DoorStuff*)script->functionTemp[1]; doorStuff->unk_0A = func_80134240(); func_80134230(doorStuff->unk_08); @@ -114,12 +114,12 @@ ApiStatus func_80282774(ScriptInstance* script, s32 isInitialCall) { } ApiStatus func_802827A8(ScriptInstance* script, s32 isInitialCall) { - func_80134230(((DoorStuff*)script->functionTemp[1].s)->unk_0A); + func_80134230(((DoorStuff*)script->functionTemp[1])->unk_0A); return ApiStatus_DONE2; } ApiStatus func_802827CC(ScriptInstance* script, s32 isInitialCall) { - DoorStuff* temp = script->functionTemp[1].s; + DoorStuff* temp = script->functionTemp[1]; script->varTable[2] = temp->unk_04; script->varTable[3] = temp->unk_0C; @@ -139,6 +139,6 @@ ApiStatus func_802827CC(ScriptInstance* script, s32 isInitialCall) { } ApiStatus func_80282868(ScriptInstance* script, s32 isInitialCall) { - script->varTable[1] = script->functionTemp[1].s; + script->varTable[1] = script->functionTemp[1]; return ApiStatus_DONE2; } diff --git a/src/world/script_api/7E4690.c b/src/world/script_api/7E4690.c index b374f02fe6..5a27431cab 100644 --- a/src/world/script_api/7E4690.c +++ b/src/world/script_api/7E4690.c @@ -80,12 +80,12 @@ ApiStatus PlayerMoveToDoor(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; if (isInitialCall) { - script->functionTemp[0].s = get_variable(script, *args++); - move_player(script->functionTemp[0].s, playerStatus->targetYaw, playerStatus->runSpeed); + script->functionTemp[0] = get_variable(script, *args++); + move_player(script->functionTemp[0], playerStatus->targetYaw, playerStatus->runSpeed); } - script->functionTemp[0].s--; - return script->functionTemp[0].s < 0; + script->functionTemp[0]--; + return script->functionTemp[0] < 0; } INCLUDE_ASM(s32, "world/script_api/7E4690", GetEntryCoords); diff --git a/tools/substitute2.py b/tools/substitute2.py index 8ca17584bf..b7da77db96 100644 --- a/tools/substitute2.py +++ b/tools/substitute2.py @@ -4,7 +4,7 @@ RUN_ME = False if not RUN_ME: print(f"Are you sure yo uwant to run this? Edit RUN_ME in the script if so") exit() - + FUNC=""" Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -12,7 +12,7 @@ FUNC=""" Enemy* enemy = script->owner1.enemy; if (npc->duration <= 0) { enemy->varTable[2] = 0; npc->duration = 0; - script->functionTemp[0].s = 0; + script->functionTemp[0] = 0; } }""".splitlines() @@ -34,8 +34,8 @@ def parse_folder(path): i = 0 while i < len(fd): - if (#i+2 < len(fd) and - fd[i].startswith("INCLUDE_ASM") or + if (#i+2 < len(fd) and + fd[i].startswith("INCLUDE_ASM") or fd[i].startswith("ApiStatus N(") or fd[i].startswith("void N(")): #and fd[i+1] == "/*"): @@ -65,7 +65,7 @@ def parse_folder(path): name_start = fd[base_name].find("N(") name_end = fd[base_name].find("(",name_start+2) new_file_name = fd[base_name][:name_start] + "N(" + NEW_FUNC_NAME + ")" + fd[base_name][name_end:] - + new_fd = ["#include \"common.h\"", "#include \"map.h\"", "", diff --git a/ver/us/asm/nonmatchings/1f580_len_1940/BindNpcAI.s b/ver/us/asm/nonmatchings/encounter_api/BindNpcAI.s similarity index 100% rename from ver/us/asm/nonmatchings/1f580_len_1940/BindNpcAI.s rename to ver/us/asm/nonmatchings/encounter_api/BindNpcAI.s diff --git a/ver/us/asm/nonmatchings/1f580_len_1940/RemoveEncounter.s b/ver/us/asm/nonmatchings/encounter_api/RemoveEncounter.s similarity index 100% rename from ver/us/asm/nonmatchings/1f580_len_1940/RemoveEncounter.s rename to ver/us/asm/nonmatchings/encounter_api/RemoveEncounter.s diff --git a/ver/us/asm/nonmatchings/1f580_len_1940/RemoveNpc.s b/ver/us/asm/nonmatchings/encounter_api/RemoveNpc.s similarity index 100% rename from ver/us/asm/nonmatchings/1f580_len_1940/RemoveNpc.s rename to ver/us/asm/nonmatchings/encounter_api/RemoveNpc.s diff --git a/ver/us/asm/nonmatchings/1f580_len_1940/SetNpcAux.s b/ver/us/asm/nonmatchings/encounter_api/SetNpcAux.s similarity index 100% rename from ver/us/asm/nonmatchings/1f580_len_1940/SetNpcAux.s rename to ver/us/asm/nonmatchings/encounter_api/SetNpcAux.s diff --git a/ver/us/asm/nonmatchings/1f580_len_1940/StartBossBattle.s b/ver/us/asm/nonmatchings/encounter_api/StartBossBattle.s similarity index 100% rename from ver/us/asm/nonmatchings/1f580_len_1940/StartBossBattle.s rename to ver/us/asm/nonmatchings/encounter_api/StartBossBattle.s diff --git a/ver/us/asm/nonmatchings/1f580_len_1940/start_battle.s b/ver/us/asm/nonmatchings/encounter_api/start_battle.s similarity index 100% rename from ver/us/asm/nonmatchings/1f580_len_1940/start_battle.s rename to ver/us/asm/nonmatchings/encounter_api/start_battle.s diff --git a/ver/us/asm/nonmatchings/104940_len_dc0/entity_base_block_update_slow_sinking.s b/ver/us/asm/nonmatchings/entity/Block/entity_base_block_update_slow_sinking.s similarity index 100% rename from ver/us/asm/nonmatchings/104940_len_dc0/entity_base_block_update_slow_sinking.s rename to ver/us/asm/nonmatchings/entity/Block/entity_base_block_update_slow_sinking.s diff --git a/ver/us/asm/nonmatchings/104940_len_dc0/entity_block_handle_collision.s b/ver/us/asm/nonmatchings/entity/Block/entity_block_handle_collision.s similarity index 100% rename from ver/us/asm/nonmatchings/104940_len_dc0/entity_block_handle_collision.s rename to ver/us/asm/nonmatchings/entity/Block/entity_block_handle_collision.s diff --git a/ver/us/asm/nonmatchings/10A230/entity_BlueWarpPipe_setupGfx.s b/ver/us/asm/nonmatchings/entity/BlueWarpPipe/entity_BlueWarpPipe_setupGfx.s similarity index 100% rename from ver/us/asm/nonmatchings/10A230/entity_BlueWarpPipe_setupGfx.s rename to ver/us/asm/nonmatchings/entity/BlueWarpPipe/entity_BlueWarpPipe_setupGfx.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_adjust_camera.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_adjust_camera.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_adjust_camera.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_adjust_camera.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_begin_opening.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_begin_opening.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_begin_opening.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_begin_opening.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_check_opened.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_check_opened.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_check_opened.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_check_opened.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_clear_item_id.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_clear_item_id.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_clear_item_id.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_clear_item_id.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_close.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_close.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_close.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_close.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_enable_player_input.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_enable_player_input.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_enable_player_input.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_enable_player_input.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_idle.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_idle.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_idle.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_idle.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_init.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_init.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_init.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_init.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_open.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_open.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_open.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_open.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_readargs.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_readargs.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_readargs.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_readargs.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_reset_camera.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_reset_camera.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_reset_camera.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_reset_camera.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_setupGfx.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_setupGfx.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_setupGfx.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_setupGfx.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_start_bound_script.s b/ver/us/asm/nonmatchings/entity/Chest/entity_Chest_start_bound_script.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_Chest_start_bound_script.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_Chest_start_bound_script.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_await_got_item.s b/ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_await_got_item.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_await_got_item.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_await_got_item.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_give_equipment.s b/ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_give_equipment.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_give_equipment.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_give_equipment.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_hide_effect.s b/ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_hide_effect.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_hide_effect.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_hide_effect.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_init.s b/ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_init.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_init.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_init.s diff --git a/ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_open.s b/ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_open.s similarity index 100% rename from ver/us/asm/nonmatchings/1086a0_len_fc0/entity_GiantChest_open.s rename to ver/us/asm/nonmatchings/entity/Chest/entity_GiantChest_open.s diff --git a/ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent__anim_heal.s b/ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent__anim_heal.s similarity index 100% rename from ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent__anim_heal.s rename to ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent__anim_heal.s diff --git a/ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent__setupGfx.s b/ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent__setupGfx.s similarity index 100% rename from ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent__setupGfx.s rename to ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent__setupGfx.s diff --git a/ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent_anim_beating.s b/ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent_anim_beating.s similarity index 100% rename from ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent_anim_beating.s rename to ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent_anim_beating.s diff --git a/ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent_anim_idle.s b/ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent_anim_idle.s similarity index 100% rename from ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent_anim_idle.s rename to ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent_anim_idle.s diff --git a/ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent_get_previous_yaw.s b/ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent_get_previous_yaw.s similarity index 100% rename from ver/us/asm/nonmatchings/105F90/entity_HeartBlockContent_get_previous_yaw.s rename to ver/us/asm/nonmatchings/entity/HeartBlock/entity_HeartBlockContent_get_previous_yaw.s diff --git a/ver/us/asm/nonmatchings/105700_len_2130/entity_HitItemBlock_appear.s b/ver/us/asm/nonmatchings/entity/ItemBlock/entity_HitItemBlock_appear.s similarity index 100% rename from ver/us/asm/nonmatchings/105700_len_2130/entity_HitItemBlock_appear.s rename to ver/us/asm/nonmatchings/entity/ItemBlock/entity_HitItemBlock_appear.s diff --git a/ver/us/asm/nonmatchings/105700_len_2130/entity_ItemBlock_spawn_item.s b/ver/us/asm/nonmatchings/entity/ItemBlock/entity_ItemBlock_spawn_item.s similarity index 100% rename from ver/us/asm/nonmatchings/105700_len_2130/entity_ItemBlock_spawn_item.s rename to ver/us/asm/nonmatchings/entity/ItemBlock/entity_ItemBlock_spawn_item.s diff --git a/ver/us/asm/nonmatchings/102610_len_2330/entity_SaveBlock_setupGfx.s b/ver/us/asm/nonmatchings/entity/SaveBlock/entity_SaveBlock_setupGfx.s similarity index 100% rename from ver/us/asm/nonmatchings/102610_len_2330/entity_SaveBlock_setupGfx.s rename to ver/us/asm/nonmatchings/entity/SaveBlock/entity_SaveBlock_setupGfx.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_flip_over.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_flip_over.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_flip_over.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_flip_over.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_hide.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_hide.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_hide.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_hide.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_idle.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_idle.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_idle.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_idle.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_init.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_init.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_init.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_init.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_is_item_on_top.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_is_item_on_top.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_is_item_on_top.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_is_item_on_top.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_set_ispy_notification.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_set_ispy_notification.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_set_ispy_notification.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_set_ispy_notification.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_setupGfx.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_setupGfx.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_HiddenPanel_setupGfx.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_HiddenPanel_setupGfx.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_ScriptSpring_idle.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_ScriptSpring_idle.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_ScriptSpring_idle.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_ScriptSpring_idle.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_SimpleSpring_enable_player_input.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_SimpleSpring_enable_player_input.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_SimpleSpring_enable_player_input.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_SimpleSpring_enable_player_input.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_SimpleSpring_idle.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_SimpleSpring_idle.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_SimpleSpring_idle.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_SimpleSpring_idle.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_SimpleSpring_init.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_SimpleSpring_init.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_SimpleSpring_init.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_SimpleSpring_init.s diff --git a/ver/us/asm/nonmatchings/107830_len_e70/entity_SimpleSpring_set_jump_params.s b/ver/us/asm/nonmatchings/entity/SimpleSpring/entity_SimpleSpring_set_jump_params.s similarity index 100% rename from ver/us/asm/nonmatchings/107830_len_e70/entity_SimpleSpring_set_jump_params.s rename to ver/us/asm/nonmatchings/entity/SimpleSpring/entity_SimpleSpring_set_jump_params.s diff --git a/ver/us/asm/nonmatchings/106EF0/entity_SuperBlock_HitEffect_setupGfx.s b/ver/us/asm/nonmatchings/entity/SuperBlock/entity_SuperBlock_HitEffect_setupGfx.s similarity index 100% rename from ver/us/asm/nonmatchings/106EF0/entity_SuperBlock_HitEffect_setupGfx.s rename to ver/us/asm/nonmatchings/entity/SuperBlock/entity_SuperBlock_HitEffect_setupGfx.s diff --git a/ver/us/asm/nonmatchings/102C80/entity_RedSwitch_animate_scale.s b/ver/us/asm/nonmatchings/entity/Switch/entity_RedSwitch_animate_scale.s similarity index 100% rename from ver/us/asm/nonmatchings/102C80/entity_RedSwitch_animate_scale.s rename to ver/us/asm/nonmatchings/entity/Switch/entity_RedSwitch_animate_scale.s diff --git a/ver/us/asm/nonmatchings/102C80/entity_base_switch_animate_scale.s b/ver/us/asm/nonmatchings/entity/Switch/entity_base_switch_animate_scale.s similarity index 100% rename from ver/us/asm/nonmatchings/102C80/entity_base_switch_animate_scale.s rename to ver/us/asm/nonmatchings/entity/Switch/entity_base_switch_animate_scale.s diff --git a/ver/us/asm/nonmatchings/102C80/entity_shattering_idle.s b/ver/us/asm/nonmatchings/entity/Switch/entity_shattering_idle.s similarity index 100% rename from ver/us/asm/nonmatchings/102C80/entity_shattering_idle.s rename to ver/us/asm/nonmatchings/entity/Switch/entity_shattering_idle.s diff --git a/ver/us/asm/nonmatchings/102C80/entity_shattering_init_pieces.s b/ver/us/asm/nonmatchings/entity/Switch/entity_shattering_init_pieces.s similarity index 100% rename from ver/us/asm/nonmatchings/102C80/entity_shattering_init_pieces.s rename to ver/us/asm/nonmatchings/entity/Switch/entity_shattering_init_pieces.s diff --git a/ver/us/asm/nonmatchings/102C80/entity_shattering_setupGfx.s b/ver/us/asm/nonmatchings/entity/Switch/entity_shattering_setupGfx.s similarity index 100% rename from ver/us/asm/nonmatchings/102C80/entity_shattering_setupGfx.s rename to ver/us/asm/nonmatchings/entity/Switch/entity_shattering_setupGfx.s diff --git a/ver/us/asm/nonmatchings/109660_len_1270/entity_WoodenCrate_init_fragments.s b/ver/us/asm/nonmatchings/entity/WoodenCrate/entity_WoodenCrate_init_fragments.s similarity index 100% rename from ver/us/asm/nonmatchings/109660_len_1270/entity_WoodenCrate_init_fragments.s rename to ver/us/asm/nonmatchings/entity/WoodenCrate/entity_WoodenCrate_init_fragments.s diff --git a/ver/us/asm/nonmatchings/109660_len_1270/entity_WoodenCrate_setupGfx.s b/ver/us/asm/nonmatchings/entity/WoodenCrate/entity_WoodenCrate_setupGfx.s similarity index 100% rename from ver/us/asm/nonmatchings/109660_len_1270/entity_WoodenCrate_setupGfx.s rename to ver/us/asm/nonmatchings/entity/WoodenCrate/entity_WoodenCrate_setupGfx.s diff --git a/ver/us/asm/nonmatchings/109660_len_1270/entity_WoodenCrate_update_fragments.s b/ver/us/asm/nonmatchings/entity/WoodenCrate/entity_WoodenCrate_update_fragments.s similarity index 100% rename from ver/us/asm/nonmatchings/109660_len_1270/entity_WoodenCrate_update_fragments.s rename to ver/us/asm/nonmatchings/entity/WoodenCrate/entity_WoodenCrate_update_fragments.s diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index e853d98179..495c871d8d 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -72,7 +72,7 @@ segments: - [0x13480, c, state_demo] - [0x13870, c, npc] - [0x1a1f0, c, 1a1f0_len_5390] - - [0x1f580, c, 1f580_len_1940] + - [0x1f580, c, encounter_api] - [0x20ec0, c, 20ec0_len_5040] - [0x23680, c] - [0x25AF0, c] @@ -433,18 +433,18 @@ segments: start: 0x102610 vram: 0x802E0D90 subsegments: - - [0x102610, c, 102610_len_2330] - - [0x102C80, c, 102C80] + - [0x102610, c, entity/SaveBlock] + - [0x102C80, c, entity/Switch] - [0x104730, c, 104730] - - [0x104940, c, 104940_len_dc0] - - [0x105700, c, 105700_len_2130] - - [0x105F90, c, 105F90] - - [0x106EF0, c] - - [0x107830, c, 107830_len_e70] - - [0x1086a0, c, 1086a0_len_fc0] - - [0x109660, c, 109660_len_1270] - - [0x10A230, c, 10A230] - - [0x10A8D0, c, 10A8D0] + - [0x104940, c, entity/Block] + - [0x105700, c, entity/ItemBlock] + - [0x105F90, c, entity/HeartBlock] + - [0x106EF0, c, entity/SuperBlock] + - [0x107830, c, entity/SimpleSpring] + - [0x1086a0, c, entity/Chest] + - [0x109660, c, entity/WoodenCrate] + - [0x10A230, c, entity/BlueWarpPipe] + - [0x10A8D0, c, entity/Signpost] - [0x10A9F0, data] #- [0x10A9F0, i4, shadow/square, 16, 16] #- [0x10AA70, i4, shadow/circle, 16, 16]